android

Why isn't the thread stopping?

My service spawns a new thread, and stops it according to the typically recommended java method of interrupt()'ing. When I stop the service, I stop the thread in onDestroy(). The service is stopped, and the interrupt code is reached. However, soon enough the thread restarts from the beginning of the Runnable. public class DoScan extends...

How can you prevent somebody from calling in Android ?

I want to write a software to allow the parents to set a limit to their children phone calls. I need to lock some phone capabilities with a password after the limits are reached. I'd like to know how I can block phone calls from being made, and receive. And if it's possible to set a white list for emergency calls (e.g : the teen can't ...

Change intent bundle data before an activity is re-created after orientation change

I have a notification that starts my activity and passes a messages using the intent's putExtra() function. The message is then displayed to the user in the activity's onCreate function. When the application is restarted due to a orientation change, the message is shown again as it is still in the intent's bundled data. How can I remov...

Android: where to find NetworkPreference enum?

Hi, I tried to call the method ConnectivityManager.setNetworkPreference(NetworkPreference.PREFER_WIFI); //example from Professional Android Application Development book but the method argument from the example seems to be obsolete. Does anyone know where to find network preference enumerators? Thanks ...

iPhone versus Android : Developer results

For those developers here who have tried both platforms and published some apps in their respective app stores, how have the results been for you? Pros and Cons? I'm curious on current real-world experiences, not analyst projections. I believe this too will help people get off the fence and choose which side to develop for. Thanks. ...

Android: How to monitor WiFi signal strength

Hi, I would receive notifications when signal strength changes. I tried to create the following method and call it in the onCreate(): private void initializeWiFiListener(){ Log.i(TAG, "executing initializeWiFiListener"); String connectivity_context = Context.WIFI_SERVICE; final WifiManager wifi = (WifiManager)getSystemService(conne...

Sending a notification from a service in Android

Hi, I have a service running, and would like to send a notification. Too bad, the notification object requires a context, like an Activity, and not a service. Do you know any way to by pass that ? I tried to create an Activity for each notification bu it seems ugly, and I can't find a way to launch an Activity without any view. ...

storing android application data on SD Card

is there a way to store android application data on the SDCard instead of the internal memory? I know how to transfer the application sqlite database from the internal memory to the SDCard, but what if the internal memory gets full in the first place? how does everyone handle this? ...

Multiple Android expandable lists in a layout

I want to have more than one expandable list within a layout. It appears that an expandable list in a custom layout must have an id of "@id/android:list". So, how could I have more than one if they would need to have the same id? Thanks... ...

Android, add new view without XML Layout

Posted: Thu Jul 30, 2009 6:09 pm Post subject: How to show small View? I need a little help from people with expirience. I hope it's easy. I just want to show new View (creating it without XML layouts) above main program's view. It's to integrate AdMob.com ad block: I wrote such code: AdView ad = new AdView(this); ad.layout(10,...

What is gesture in Android.

I would like to know what is meant by gestures in typical mobiles more specifically android ones. Android supports gesture recognition. Is a gesture termed as when user holds the device and shakes it(say upwards, downwards or side- side)? Is a gesture termed as when a finger is placed on the screen and traced UP,DOWN,RIGHT,LEFT? If so ...

Mobile Development barrier to entry.

I'm looking at making some mobile apps in my spare time and I want to be able to put them up online for anyone to use (and probably open-source). I've worked with PyS60 a while ago and I really liked it. My problem is, I don't want to spend any money on these apps (I'm not planning on making money from them in any way) and for me to p...

Android: Is it more efficient to use a text file or an XML file to store static data

I have some reference data in a text file (~5MB) that I want to use with might android application. The file is of the format: 1|a|This is line 1a 1|b|This is line 1b 2|a|This is line 2a 2|b|This is line 2b 2|c|This is line 2c What I want to know is the most efficient way (less memory, fast, size etc.) to use this file within my appl...

Is it realistic for an android newbie to successfully complete a project in 30 days and submit it to ADC2?

Hi, Just for the disclaimer, I'm not trying to win the prize in Android Developer Challenge, but just want to participate. I heard about the Android buzz lately and got interested in it. And today I stumbled upon a site talking about Android Developer Challenge 2. Luckily, the submission hasn't ended but unfortunately it starts tomorrow...

SD-Card Life while using it to store a data structure

I have come up with a disk-based data structure to store incoming realtime data, this is not in memory becuase the array can fill up and cause the jvm to crash. The data-strcture and algorithm work great. My only question is that does this greatly affect the life of an sdcard? I know sdcards have limited read and writes on them, but how...

Programmatically Fling ListView Android

Is there a way I can programatically perform a Fling on a listview? I know there is monkey that does all these things but that requires a computer connection with adb etc etc. I want to do it with my app on any phone, without monkey. Thanks, Faisal ...

Is it legal to call the start method twice on the same Thread?

The following code leads to "java.lang.IllegalThreadStateException: Thread already started." the second time it is run through on the program. updateUI.join(); if (!updateUI.isAlive()) updateUI.start(); This happens the second time updateUI.start() is called. I've stepped through it multiple times and the thread is called ...

Android LinearLayout fill-the-middle

I have a vertical, set height (300px) LinearLayout (LL) with 3 nested LLs. 1 and 3rd are set with android:layout_height="wrap_content" and the middle one with android:layout_height="fill_parent". To my dismay, 3rd LL gets pushed out with 2nd one filling parent layout right to the bottom. How do I achieve desired effect since I want poten...

How to add share menu item to Gallery by code

I know how to implement this issue by Menuifest.xml, see also: Google Android Developer Group related issue But my question is how to add share menu of Gallery by java code not Menuifest.xml. My code is as below: public class MyActivity extends Activity { private static final String TAG = "MyActivity"; @Override public void onCreat...

Creating an object of activity class

Hi, I am having an class which extends Activity and i am trying to create an object of that class in normal java class ,It is giving me an exception "Cant create handler inside thread that has not called looper.prepare" ,what i am doing wrong Thnx in advance. ...