Delete Bitmap Android Example
If some memory leak - problem try release of memory used of a big Bitmap what already not to need;
//developer.android.com/reference/android/graphics/Bitmap.html
Free the native object associated with this bitmap, and clear the reference to the pixel data. This will not free the pixel data synchronously; it simply allows it to be garbage collected if there are no other references. The bitmap is marked as "dead”, meaning it will throw an exception if getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed, so it should only be called if you are sure there are no further uses for the bitmap. This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.
Bitmpap bmp; // not null
bmp.recycle();
bmp = null;
final boolean bmpIsRecycled = bmp.isRecycled()
// Returns true if this bitmap has been recycled.
//developer.android.com/reference/android/graphics/Bitmap.html
Free the native object associated with this bitmap, and clear the reference to the pixel data. This will not free the pixel data synchronously; it simply allows it to be garbage collected if there are no other references. The bitmap is marked as "dead”, meaning it will throw an exception if getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed, so it should only be called if you are sure there are no further uses for the bitmap. This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.
396LW NO topic_id
AD
Další témata ....(Topics)
Table of usability phones with Android: (Our software)
Graph of usability Smartphone with Android - October 2011:
Samsung Galaxy S2 vs iPhone4 - browsing, gaming, apps, performance, browser, fast, against, navigation, Sygic, apk, Android, iOS
October 2011 | September 2011 | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Graph of usability Smartphone with Android - October 2011:

Samsung Galaxy S2 vs iPhone4 - video
Samsung Galaxy S2 vs iPhone4 - browsing, gaming, apps, performance, browser, fast, against, navigation, Sygic, apk, Android, iOS
If you change the package name, you have to add new package name in:
DictionaryProvider.java
Do not forget change package name in all java class and xml/searchable.xml
In my project I changed like this:
DictionaryProvider.java
public class DictionaryProvider extends ContentProvider {
String TAG = "DictionaryProvider";
// public static String AUTHORITY = "com.example.android.searchabledict.DictionaryProvider";
// change to your new package name
public static String AUTHORITY = "com.myweb.mysubdomen.searchabledict.DictionaryProvider";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/dictionary");
// in AndroidManifest.xml
//change com.example.android to your package e.g. com.myweb.mysubdomen
<!-- Provides search suggestions for words and their definitions. -->
<provider android:name="com.example.android.searchabledict.DictionaryProvider"
android:configChanges="keyboard|keyboardHidden|orientation"
android:authorities="com.example.android.searchabledict.DictionaryProvider" />
<!-- Points to searchable activity so the whole app can invoke search. -->
<meta-data android:name="android.app.default_searchable"
android:configChanges="keyboard|keyboardHidden|orientation"
android:value=".SearchableDictionary" />
// I change like this:
<!-- Provides search suggestions for words and their definitions. -->
<provider android:name=".DictionaryProvider"
android:configChanges="keyboard|keyboardHidden|orientation"
android:authorities="cz.okhelp.android.searchabledict.DictionaryProvider" />
<!-- Points to searchable activity so the whole app can invoke search. -->
<meta-data android:name="android.app.default_searchable"
android:configChanges="keyboard|keyboardHidden|orientation"
android:value=".SearchableDictionary" />
Do not forget change package name in all java class and xml/searchable.xml
In my project I changed like this:
<searchable xmlns:android="//schemas.android.com/apk/res/android"
android:label="@string/search_label"
android:hint="@string/search_hint"
android:searchSettingsDescription="@string/settings_description"
android:searchSuggestAuthority="cz.okhelp.android.searchabledict.DictionaryProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://cz.okhelp.android.searchabledict.DictionaryProvider/dictionary"
android:searchSuggestSelection=" ?"
android:searchSuggestThreshold="1"
android:includeInGlobalSearch="true"
>
</searchable>
Try this code:
final String ERROR = "my error message....";
private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
// some code and method ..... see AsyncTask
@Override
protected String doInBackground(String... urls) {
URL urlL = null;
try {
urlL = new URL(url);//"//chmi.cz..../"
HttpURLConnection urlConnection = null;
try {
urlConnection = (HttpURLConnection) urlL.openConnection();
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
response = readStream(in);
return response;
} catch (IOException e) {
//throw new RuntimeException(e);
} finally {
if(urlConnection != null)
urlConnection.disconnect();
return ERROR;
}
} catch (MalformedURLException e) {
e.printStackTrace();
return ERROR;
}
}
return response;
}
private String readStream(InputStream is) {
try {
ByteArrayOutputStream bo = new ByteArrayOutputStream();
int i = is.read();
while(i != -1) {
bo.write(i);
i = is.read();
}
return bo.toString();
} catch (IOException e) {
return "";
}
}
Samsung Galaxy S II cena od 10 000 KCZ Kč (únor.2012).
Asi nejlepší smartphone (cena : vlastnosti) telefon s Androidem roku 2011.
Samsung Galaxy S II (GT-I9100) je chytrý telefon běžící na operačním systému Android, který byl představen firmou Samsung 13. února 2011.
Samsung Galaxy S II je (22.února2012) nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.
Proč je Samsung Galaxy S2 tak oblíben?
Galaxy S II má 1.2 GHz dual-core "Exynos" procesor, 1 GB RAM, 10,8 cm WVGA AMOLED Super Plus displej a fotoaparát s 8 miliony pixelů i s bleskem a plné vysoké rozlišení 1080p nahrávání videa. Je to jedno z prvních zařízení, které nabízí mobilní high-definition Link (MHL), který umožňuje až 1080p nekomprimovaného obrazového výstupu HDMI. USB On-The-Go (USB OTG) je podporováno.
Vyměnitelná baterie na Galaxy S II vydrží až deset hodin při intenzivním používání, nebo dva dny lehčí provoz. Podle společnosti Samsung, Galaxy S II je schopen poskytovat 9 hodin hovoru v 3G a 18,3 hodin na 2G síti.
Samsung Galaxy S2 photo pic image
Zdroj obrázku: wikipedia
Asi nejlepší smartphone (cena : vlastnosti) telefon s Androidem roku 2011.
Samsung Galaxy S II (GT-I9100) je chytrý telefon běžící na operačním systému Android, který byl představen firmou Samsung 13. února 2011.
Samsung Galaxy S II je (22.února2012) nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.
Proč je Samsung Galaxy S2 tak oblíben?
Galaxy S II má 1.2 GHz dual-core "Exynos" procesor, 1 GB RAM, 10,8 cm WVGA AMOLED Super Plus displej a fotoaparát s 8 miliony pixelů i s bleskem a plné vysoké rozlišení 1080p nahrávání videa. Je to jedno z prvních zařízení, které nabízí mobilní high-definition Link (MHL), který umožňuje až 1080p nekomprimovaného obrazového výstupu HDMI. USB On-The-Go (USB OTG) je podporováno.
Vyměnitelná baterie na Galaxy S II vydrží až deset hodin při intenzivním používání, nebo dva dny lehčí provoz. Podle společnosti Samsung, Galaxy S II je schopen poskytovat 9 hodin hovoru v 3G a 18,3 hodin na 2G síti.
Samsung Galaxy S2 photo pic image

Zdroj obrázku: wikipedia
Code look up at the Api Demos
android_fragments arguments attributes - three fragments on screen
android_fragments_alert_dialog
android_fragments_context_menu
android_fragments_custom_animation
android_fragments_dialog
android_fragments_dialog_or_activity
fragment_hide_show
fragment_layout
fragments_list_array
fragment_menu
android_fragments_get_result_from_fragment and tabs in two rows
android_fragments_recive_result
android_fragments_stack
fragment_tabs
android_fragments arguments attributes - three fragments on screen

android_fragments_alert_dialog

android_fragments_context_menu

android_fragments_custom_animation

android_fragments_dialog

android_fragments_dialog_or_activity

fragment_hide_show

fragment_layout

fragments_list_array

fragment_menu

android_fragments_get_result_from_fragment and tabs in two rows

android_fragments_recive_result

android_fragments_stack

fragment_tabs

Editace: 2013-12-09 12:59:36
Počet článků v kategorii: 396
Url:delete-bitmap-android-example