setTesting(boolean) from the type AdRequest is deprecated
Admob testing on emulator issue.
Android Eclipse code warning:
setTesting(boolean) from the type AdRequest is deprecated
Solution:
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
Android Eclipse code warning:
setTesting(boolean) from the type AdRequest is deprecated
Solution:
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
AdView adView = new AdView(this, AdSize.BANNER, "a14d9..........");//MY_AD_UNIT_ID
AdRequest adRequest = new AdRequest();
adRequest.setTesting(true); // deprecated
adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // OK
adView.loadAd(adRequest);
396LW NO topic_id
AD
Další témata ....(Topics)
Problem: erroneous entry of id
Solution: @+id/
<RadioButton android:id="idRadio"
android:text="My radio button"/>
Solution: @+id/
<RadioButton android:id="@+id/idRadio"
android:text="My radio button"/>
Activity.java
\res\layout\main.xml
location TouchImageView\src\cz\okhelp\TouchImageView\TouchImageView.java
public class A extends Activity{
Bitmap bm;
TouchImageView touch;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bm = BitmapFactory.decodeResource(getResources(), R.drawable.chinese_sky_map);
touch = (TouchImageView)findViewById(R.id.myImageView);
touch.setImageBitmap(bm);
}
}
\res\layout\main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello" />
<cz.okhelp.TouchImageView.TouchImageView
android:id="@+id/myImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
location TouchImageView\src\cz\okhelp\TouchImageView\TouchImageView.java
public class TouchImageView extends ImageView {
Context context;
// constructor wihtout using *.xml file
// public TouchImageView(Context context) {
// super(context);
// }
// constructor with xml file
public TouchImageView(Context context, AttributeSet attrs)
{
super(context, attrs);
super.setClickable(true);
this.context = context;
}
}
// Context instead Activity as a parameter
@Override
public void onAttach(Context context) {
super.onAttach(context);
Activity a;
if (context instanceof Activity){
a=(Activity) context;
}
}
OnNoteClickedListener listener;
/* old emxample of usage
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
listener = (OnNoteClickedListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnNoteClickedListener");
}
}
*/
// new version of code
@Override
public void onAttach(Context context) {
super.onAttach(context);
Activity a;
if (context instanceof Activity){
a=(Activity) context;
try {
listener = (OnNoteClickedListener) a;
} catch (ClassCastException e) {
throw new ClassCastException(a.toString()
+ " must implement OnNoteClickedListener");
}
}
}
Map TreeMap sorted by value Java Android example.
MainClass.java
MainClass.java
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
public class MainClass {
public static void main(String[] arg) {
// english;germany dictionary
String[] arrayOfString = { "one;eine", "two;zwei", "three;drei",
"four;vier" };
Map<String, String> map = new TreeMap<String, String>();
for (String s : arrayOfString) {
String[] array = s.split(";");
String sKey = "", sValue = "";
if (array.length > 1) {
sKey = array[0];
sValue = array[1];
map.put(sKey, sValue);
}
}
for (Entry<String, String> entry: mapSortedByValues(map)) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
}
static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> mapSortedByValues(
Map<K, V> map) {
SortedSet<Map.Entry<K, V>> sortedSetOfEntries = new TreeSet<Map.Entry<K, V>>(
new Comparator<Map.Entry<K, V>>() {
@Override
public int compare(Map.Entry<K, V> entry_1, Map.Entry<K, V> entry_2) {
int res = entry_1.getValue().compareTo(entry_2.getValue());
return res != 0 ? res : 1;
// return entry_1.getValue().compareTo(entry_2.getValue());
}
});
sortedSetOfEntries.addAll(map.entrySet());
return sortedSetOfEntries;
}
}
/*
three = drei
one = eine
four = vier
two = zwei
*/
Nejlepší Smartphone jaro 2012.
Pdf file
Video - záznam a kvalita videa HTC One S
**VIDEO YOUTUBE
Brand | HTC |
---|---|
Model (codename) | One S |
Price - (Cena, včetně DPH) | 13000 |
Display size in Inch (v palcích) | 4.3 |
Display-resolution (rozlišení) | 960x540 |
Dotek-typ | multi-touch capacitive |
CPU typ | MSM8260A |
CPU MHz | 1500 |
CPU core | 2 |
L2 cache | |
ROM | 16 GB |
RAM | 1 GB |
GPU | Adreno 225 |
NenaMark2 Benchmark | |
GPU-GLBenchmark | |
Battery mAh | 1650 mAh, 10.5 hours of talk time and 13.2 days of stand-by time |
Foto MPx | 8 |
Autofocus | AF |
Video | HD záznam videa, 1920×1080 (1080p HD) @ 30 frame/s - 3GP, .3G2, MP4, WMV, AVI |
Official Android ICS | Android 4.0 Ice Cream Sandwich, HTC Sense 4.0 overlay |
CyanogenMod support | |
Dotek-prstů-max | |
Display-ppi | |
Display-retina | |
Network | HSPA/WCDMA: • Europe/Asia: 850/900/2100 MHz GSM/GPRS/EDGE: • 850/900/1800/1900 MHz |
Connectivity | 3.5 mm stereo audio jack Bluetooth with aptX™ enabled (Bluetooth® 4.0) Wi-Fi®: IEEE 802.11b/g/n DLNA® for wirelessly streaming media from the phone to a compatible TV or computer micro-USB 2.0 (5-pin) port with mobile high-definition video link (MHL) for USB or HDMI connection (Special cable required for HDMI connection.) |
Pozn. |
Pdf file
Video - záznam a kvalita videa HTC One S
**VIDEO YOUTUBE
Editace: 2013-05-25 11:40:11
Počet článků v kategorii: 396
Url:settestingboolean-from-the-type-adrequest-is-deprecated