android

Programatically connecting to another Network operators

I am trying to do a little app to list and connect to other Network operator. I list them by going to: Settings Wireless Controls Mobile networks Network operators Search networks And I connect to other Network operator by clicking on one of the list. I've been searching methods from ConnectivityManager but I don't find something l...

roaming detection in android

Hi, I'm trying to detect when the roaming activation occurs. So far I've used the following piece of code, but because I haven't been able to test it I am unaware of it's correctness TelephonyManager telephonyManager = TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); PhoneStateListener cellLocationListener = new PhoneSt...

Where to find Android patches?

Hi, I have vanilla linux kernel version 2.6.27. I want to apply android specific patches and convert it to android linux kernel 2.6.27. Where can a user find the patches to convert a normal vanilla kernel into android kernel? ...

ignore OnItemSelectedListener firing on create

I'm creating a spinner and I've added an OnItemSelectedListener to it. However I've noticed that it fires on create. Now I was wondering if there was a way to ignore/discard it. I know I could use a boolean value, but that's a bit "dirty". ...

Android, Client-Server app, Bad Socket Exception

I have a simple client-server app on android. the android service communicates with the server via tcp sockets. the service sends a simple String to server which works. the server processes the string and sends back an object to the android service. the object implements the serializable interface. the object "leaves" the server successf...

How to retrieve drawable (picture) from a view?

I wrote code to draw on a view. After it is done, how can I get the resulting image from the view. For example, in the code below, I want to get the the drawable (Image) from mCustomDrawableView. How can I do that? Thanks. public class HelloTestGraph extends Activity { /** Called when the activity is first created. */ // @Overr...

Android maps overlay

Hi,how can i add different overlays at different zoom levels ? For instance i have an overlay image of a festival area that ive added onto the map which is great. But when the user zooms out i want to change the image that the user see's .Does anyone know how to do this? ...

Android search list while typing

How can i build a search bar where while i'm typing the results are shown in the list view in which i'm searching? For example, i have a list view with 20 strings. I press the search key and appears the bar. I want when i type 3 words or more the search starts running showing the results in the list view (as a filter: only shows the str...

How Can i activate/deactivate a PDP context in the Android phone by calling an API??

Hi, i need to activate/deactivate a PDP context in an android phone. so i accessed the telephony database of the phone and changed the APN settings (MCC,MNC, APN name) using SQLITE.(via a perl script) But this mechanism is only changing the database and not updating the "android.provider.telephony" could anybody help me how can i make...

How To debug Android app on Emulator using NetBeans IDE

I recently downloaded the latest NetBeans IDE (for MACOSX) and imported/migrated a project over from the ECLIPSE environment. Everything looks, and works well... except that EMULATOR gets stuck "waiting for the debugger to attach." I tried "Attaching Debugger..." and set the PORT value to every case I've ever read about (8200, 8700, 555...

Drawing widget onto Bitmap

Hello everyone. In my app I need to draw a widget contents onto Bitmap. The code(pseudo) is as follows: AppWidgetHostView widget; Bitmap bitmap; ... widget = pickWidget(); ... bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.RGB_565); final Canvas canvas = new Canvas(bitmap); widget.draw(canvas); I'm sure that pickWidget() works...

Scroll a ListView by pixels in Android

I want to scroll the a ListView in Android by number of pixels. For example I want to scroll the list 10 pixels down (so that the first item on the list has its top 10 pixel rows hidden). I thought the obviously visible scrollBy or scrollTo methods on ListView would do the job, but they don't, instead they scroll the whole list wrongly...

Which Context to use in a activity class?

I have a class defined as public class viewGroups extends ListActivity Somewhere in the class I have objItem = new clsContactGroups(context); I am wondering what is advised to be used here? Which context? I know four choices, but maybe there are others... this this.getApplicationContext() this.getBaseContext() this.getParent() ...

Unable to access R.id from inside custom view

In my foo_layout.xml file I have a subclassed RelativeLayout: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.android.myapp.FooView android:layout_width="fill_parent" androi...

Android: Stopping method to be called twice if already running.

I'm trying to prevent my application to call the same method twice in the event of a double-click, or if the user presses different buttons quickly, almost at the same time. I have clickable Views, acting as buttons, that call the same method but passing different parameters. This is the call: startTheSearch(context, getState(), what, ...

GridView row height

I have a GridView that displays images, which are, unfortunately, of different sizes. They are shown in between two lines of text: text1.1 text1.2 ImageView(IMAGE1) ImageView(IMAGE2) text2.1 text2.2 text3.1 ImageView(IMAGE3) text4.1 etc.... If IMAGE1 is the same height as IMAGE2, everything is fine...

Custom fonts and XML layouts (Android)

I'm trying to define a GUI layout using XML files in Android. As far as I can find out, there is no way to specify that your widgets should use a custom font (e.g. one you've placed in assets/font/) in XML files and you can only use the system installed fonts. I know that, in the Java code, I could change the font of each widget manuall...

Best way to store application data when data stored and data format could change in future versions?

I'm making an Android Java app game (although this question applies to all languages really) and hope to release the first version soon. I'm nervous about how I save data in my game. My problem is that, if in a later update, I decide to store more data or store the same data in a different way, I need to be careful I don't lose or corrup...

How to properly manage task stack history w/ notifications?

We're having trouble getting our notifications and launch modes to run properly. First let me describe the behavior that we want. Our main and launcher activity is Activity.Login (Lets call this A) The next activity is always MainListActivity (Lets call this B) User Launches App Activity A starts (depending on auto-login or not, it la...

How do I get the web page contents from a Web View?

On Android, I have a WebView that is displaying a page. How do I get the page source without requesting the page again? It seems WebView should have some kind of .getPageSource() method that returns a string, but alas it does not. If I enable javascript, what is the appropriate javascript to put in this call to get the contents? // ...