android

Crazy SQLite and cursor leak on AutoComplete

In my activity, I have an AutoCompleteTextView that gets its contents from my custom adapter. I created my adapter by following this example. The adapter works so far, but I am getting so many errors on leaks and cursors that are not finalized. My question is: how do I close the db in runQueryOnBackgroundThread? Here is my method: @...

loops efficiency

I came across through a presentation(dalvik-vm-internals) on Dalvik VM, in that it is mentioned as for the below loops, we have use (2) and (3) and to avoid (7). (1) for (int i = initializer; i >= 0; i--) (2) int limit = calculate limit; for (int i = 0; i < limit; i++) (3) Type[] array = get array; for (Type obj : array) (4) for (int...

How to build correctly Android-compatible website?

I am HTML/CSS/jQuery coder. And I need to develop the website, which will be "zoomed-out" or "fitted" to 320x480 (frequently used resolution) Android mobile device screen. Or even this solutions should check my screen resolution and connect the right CSS for that. Somewhere I met that there is android.js file, which connects to HTML and ...

How to access an element present in parent view?

full code how do i access the parent activity's mail layout elements? In this case a button. I have it declared in main.xml. When a button in the listview is clicked, i want to change the text of the button in main. ...

what is purpose of xml parsing in android

i want the sample program how to use shared preference in android program ...

Unable to create a ServerSocket in eclipse (java)

Hi, i am very new to programming in java however have a lot of experience in .NET (c# & vb.net). I am trying to create a new instance of a serversocket class in eclipse IDE and when i type the following code it is giving me an "Unhandled exception type IOException" and i havent even tried to run the code yet!! I dont understand how my...

Android Incoming call screen Replacement

I wish to write an Incoming call screen replacement but I can't seem to figure-out what broadcasts/events I might need to listen to ? ...

difference between methods to scale a bitmap

Hi, There are at least two methods to scale a bitmap in Android, One is to use "inScaled, inDensity, inTargetDensity" in "BitmapFactory.Options" when decode a bitmap source. The other is to use a "Matrix" in "Bitmap.createBitmap". What I am curious is what the difference between these two method is? What about the quality of produced b...

How to erase static variables in Android

I read this Article on StackOverflow. According to this, static variables will be erased, if the class is unloaded the JVM shuts down the process dies But how to destroy / to kill my application (application process) and so to erase all static variables programmatically from my application?! Thank you, Mur UPD These static varia...

How to display a one time welcome screen?

In my android app, I need to design a Welcome Screen which will be shown to the user only once after the app is installed and opened. The app in question is a database driven app and I would love to include some 3 - 4 screens to help the user create re-usable resources for use within the app and a few tips. They would be Dialog Alerts wi...

It's possible to manage this setting "always-on mobile" (Network Setting) from SDK ?

I would change this setting "always-on mobile" (in Network Setting) from my activity, it's possible ? I have seen in Settings.System, but there is no entry about this. Thanks in advance! ...

Android: Create Contact API 2.x

Hello, using the API I am trying to create a contact, using the API 2.x and not the old one. Here http://developer.android.com/guide/topics/providers/content-providers.html it only explains the old API. I haven't found any proper tutorial, example, etc. showing how to create a contact. As far as I have figured out I have to create a raw...

2 modems & 2 GPRS connections simultaneously on Android?

Hi. I will develop on an Android device with 2 USB 3G modems plugged in. I require 2 GPRS connections to be available and used at the same time. How can I manage this? What is the best start for implementation? Thanks. ...

Cursor Wrapping/Unwrapping in ContentProvider

I’m creating ContentProvider which is a proxy of another ContentProvider (for security issues and to give access to part of functionality of full app). public class GFContactsProvider extends ContactsProvider implements DatabaseConstants { private Context mContext; private ContentResolver mContentResolver; @Override ...

android: view cpu usage of processes

Hello! Is there a process manager or task viewer for android that shows how much CPU percentage each process or even each thread in a process takes up? Thanks! ...

Is there a way to avoid size limit when using getResources().openRawResource()

I am trying to load an XML file from res/raw folder in my Android project when the app first runs. I do this with this line: InputStream xmlStream = getResources().openRawResource(R.raw.xmlfile); I then want to use a SAX Parser to get data from the XML file. When doing this LogCat shows the following error: Data exceeds UNCOMPRESS_DA...

show bitmap on a regular interval on canvas

I am using android and i have an array of bitmap and i want to show these bitmaps on a regular interval on canvas one after another at the same place/position. can anyone suggesting me the road map to do this ? Note: My canvas has multiple bitmaps & later on i will set this canvas a wallpaper. i am free to use animation to change bitm...

android: Custom (compund) control in ListView

Hi! I have a srange trouble wit the ListView: I've created the compound control public class TopicControl extends LinearLayout .... <merge xmlns:android="http://schemas.android.com/apk/res/android"&gt; <LinearLayout android:id="@+id/llTopicHeader" android:layout_width="wrap_content" android:layout_height="...

How to add TextView in Runtime?

How to add a new TextView to a layout in run time? is it possible? ...

How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?

I would like to use Charles web proxy to work with the Android emulator in Windows. I've successfully set up charles and have started the emulator with the command line: emulator -http-proxy 127.0.0.1:8888 @NexusOne I can see traffic coming from the android emulator in Charles, but the problem is that I'm developing against a live AP...