How to create icon for Android apps
First cteate big icon 512x512 px formtat .PGN in graphics editor as Photoshop, Gimp, Piant.NET and save image.
If you create new project via Eclipse and choice your 512x512 image for ic_launcher.
Eclipse will make all icons from this image for new application very well.
If you create new project via Eclipse and choice your 512x512 image for ic_launcher.
Eclipse will make all icons from this image for new application very well.
396LW NO topic_id
AD
Další témata ....(Topics)
// in AndroidManifest.xml
<Activity
android:screenOrientation="portrait" // or landscape
// in MyActivity.java
boolean mbOrientacionLandscape = false;
int nOrientation = getResources().getConfiguration().orientation;
if(mbOrientacionLandscape==true){
getResources().getConfiguration();
if(nOrientation != Configuration.ORIENTATION_LANDSCAPE)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
else{
if(nOrientation != Configuration.ORIENTATION_PORTRAIT)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Constructor SimpleCursorAdapter is deprecated.
If using api 11 and above, you can try add last parameter 0.
If using api 11 and above, you can try add last parameter 0.
Cursor cursor = managedQuery(...........,,,,);
// Specify the columns we want to display in the result
String[] from = new String[] { KEY_WORD,
KEY_DEFINITION };
// Specify the corresponding layout elements where we want the columns to go
int[] to = new int[] { R.id.word,
R.id.definition };
// deprecated
SimpleCursorAdapter words =
new SimpleCursorAdapter(this,
R.layout.result, cursor, from, to);
// working
SimpleCursorAdapter words =
new SimpleCursorAdapter(this,
R.layout.result, cursor, from, to, 0); // to, 0!!!!
//working in Fragment
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(getActivity(),
android.R.layout.simple_list_item_2, null,
new String[] { "name", "age" }, // cursor parameters
new int[] { android.R.id.text1, android.R.id.text2 }, 0);
Eclipse.
If install on device signed with proguard *.apk package and try to reinstall it by only signed package get error in parsing the package.
Uninstall the first application with bigger size from device and try install signed package which has a smaller size. Delete from download list previous downloaded *.apk.
This problem occurs when that your downloaded apk file size is less than the
size of the original apk.
If install on device signed with proguard *.apk package and try to reinstall it by only signed package get error in parsing the package.
Uninstall the first application with bigger size from device and try install signed package which has a smaller size. Delete from download list previous downloaded *.apk.
This problem occurs when that your downloaded apk file size is less than the
size of the original apk.
Example from SDK C:\Program Files\Android\android-sdk-windows\samples\android-10\ApiDemos\src\com\example\android\apis\text\Link.java
Source: //developer.android.com/resources/browser.html?tag=sample
License: //www.apache.org/licenses/LICENSE-2.0
1.) Automatically linkifies using android:autoLink="all"
2.) Link text by setMovementMethod
3.) Link as html code using Html.fromHtml()
4.) Link string by SpannableString
Source: //developer.android.com/resources/browser.html?tag=sample
License: //www.apache.org/licenses/LICENSE-2.0
1.) Automatically linkifies using android:autoLink="all"
// res/values/strings.xml
<string name="link_text_auto"><b>text1:</b> This is some text. In
this text are some things that are actionable. For instance,
you can click on //www.google.com and it will launch the
web browser. You can click on google.com too. And, if you
click on (415) 555-1212 it should dial the phone.
</string>
// main.xml
<!-- text1 automatically linkifies things like URLs and phone numbers. -->
<TextView xmlns:android="//schemas.android.com/apk/res/android"
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoLink="all"
android:text="@string/link_text_auto"
/>
2.) Link text by setMovementMethod
// MainActivity.java onCreate
/*Be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call setFocusable(boolean) again after calling this to get the focusability back the way you want it. */
TextView t2 = (TextView) findViewById(R.id.text2);
t2.setMovementMethod(LinkMovementMethod.getInstance());
// main.xml
<!-- text2 uses a string resource containing explicit <a> tags to
specify links. -->
<TextView xmlns:android="//schemas.android.com/apk/res/android"
android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/link_text_manual"
/>
//strings.xml
<string name="link_text_manual"><b>text2:</b> This is some other
text, with a <a href="//www.google.com">link</a> specified
via an <a> tag. Use a "tel:" URL
to <a href="tel:4155551212">dial a phone number</a>.
</string>
3.) Link as html code using Html.fromHtml()
// MainActivity.java onCreate
TextView t3 = (TextView) findViewById(R.id.text3);
t3.setText(
Html.fromHtml(
"<b>text3:</b> Text with a " +
"<a href="//www.google.com">link</a> " +
"created in the Java source code using HTML."));
t3.setMovementMethod(LinkMovementMethod.getInstance());
4.) Link string by SpannableString
SpannableString ss = new SpannableString(
"text4: Click here to dial the phone.");
ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 6,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new URLSpan("tel:4155551212"), 13, 17,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView t4 = (TextView) findViewById(R.id.text4);
t4.setText(ss);
t4.setMovementMethod(LinkMovementMethod.getInstance());
Basic difference remember it!!!
if(TRUE && TRUE && TRUE) return TRUE otherwise FALSE
if(FALSE || FALSE || FALSE) return FALSE otherwise TRUE
Logical operator and &&
If all conditions/operands is TRUE return TRUE, otherwise return FALSE
Logical operator or ||
The logical OR operator (||) returns the boolean value true if either or both operands is true and returns false otherwise.
If one operands is TRUE, condition is TRUE:
rev
if(TRUE && TRUE && TRUE) return TRUE otherwise FALSE
if(FALSE || FALSE || FALSE) return FALSE otherwise TRUE
Logical operator and &&
If all conditions/operands is TRUE return TRUE, otherwise return FALSE
if( true and true and true){
// return true - do something
}
int a = 6;
if(a == 6 && a == 6 ) {
// if TRUE
// true && true return true, do something
}
if(a == 6 && a == 5){
// nothing, not attended
}else{
// true && false return false, or false && false return false
// do something
}
Logical operator or ||
The logical OR operator (||) returns the boolean value true if either or both operands is true and returns false otherwise.
If one operands is TRUE, condition is TRUE:
if(FALSE OR FALSE OR TRUE) return TRUE
if(FALSE OR TRUE OR FALSE) return TRUE
if(FALSE OR FALSE OR FALSE) return FALSE
int a = 6;
if(a==6 || a==5){ // TRUE || FALSE return TRUE
//if return TRUE
//one from operadns is TRUE return true, do something
}
if(a==5 || a==4){ // FALSE || FALSE return FALSE
// not attended
}else{
//if return FALSE, do something
}
rev
Editace: 2013-12-09 13:01:14
Počet článků v kategorii: 396
Url:how-to-create-icon-for-android-apps