android

Setting number of columns programmatically in TableLayout

Hi, I have an XML layout which contains a TableLayout with an unknown number of TableRows... The number of Rows will be established durin runtime, what I do know though is that I want two columns... So I have a couple of questions regarding this : - is there a way to set the whole TableLayout to have 2 columns ? - is there a way progra...

Getting back from security & location to my application

Hi, I have an application that allows the user to enable GPS. In order to do it, first in the main activity I do: lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (!lm.isProviderEnabled(LocationManager.GPS_PROVIDER)){ showGpsOptions(); } showGpsOptions() is: privat...

problem in write file or mkdir on android device

Hi. I have a android application which is write some html files on the sdcard. The application run on emulator very well. But when I tried to run the same application on OMAP android device It can't write files or mkdir on the device sdcard. I don't know how it happened. My OMAP device use sdcard for file system at the boot time tha...

Cannot understand NullPointerException with custom adapter

hi, I am trying to create a list view which as TextView that can display html content , an WebView and other basic TextViews.I tried to extend SimpleAdapter but i struck with the problem ,I will be glad if someone can point out the mistake i am doing. In onCreate method ArrayList> mylist= resultfromXmlparser(); adap = new MyAdapter(To...

Android 2.1: can't run HelloWorld on the Emulator

I'm new in Android. I'm starting with HelloWorld program, but I can't run it on the Emulator. I'm using newest version of Eclipse and Android SDK. I also set up development environment as follows instructions on http://developer.android.com/index.html. Does anybody have advice for me? ...

How can I use spinner setOnItemLongClickListener

Hi, I am trying to make the Spinner behave different way when the user clicked on an item for a long time. I have spinner with some project and I want two things. When the user simple click on an item I want to normal select it. When the user have long clicked on an item I want to show dialog, with options like "Edit item", "Delete it...

Highlighting Text Color using Html.fromHtml() in Android?

Hi, I am developing an application in which there will be a search screen where user can search for specific keywords and that keyword should be highlighted. I have found Html.fromHtml method. But I will like to know whether its the proper way of doing it or not. Please let me know your views on this. Regards Sunil ...

Android streaming from icecast server get track information

I have a stream from an icecast server downloading, and I can grab the information in the headers by doing the following: URLConnection cn = new URL(mediaUrl).openConnection(); cn.connect(); int pos=1; String x; String y; while (cn.getHeaderField(pos) != null) { x=cn.getHeaderFieldKey(pos); y = cn...

prevent screen rotation android

I have one of my activities which I would like to prevent from rotating because I'm starting an AsyncTask, and screen rotation makes it restart. So is there any way to tell this activity "DO NOT ROTATE the screen even if the user is shaking his phone like mad"? ...

RemoteViews addView function returns errors on AppWidget

I'm trying to create a AppWidget that displays a number of items (which can change). I'd like to generate TextViews dynamically, I assume I do this by using: RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.id.widgetmain); RemoteViews newView = new RemoteViews(context.getPackageName(), R.id.widgetitem); updateViews...

Download album art from internet in an android application

I know the artist and trackname for a song, but I am unsure of what service or how to download album art for the track. I believe iTunes and Amazon both offer services but I am unsure of how to integrate these services, any links or suggestions are appreciated. ...

Radio Buttons not highlighting as though they are selected

I'm working on an android activity with a RadioGroup containing 10 RadioButtons. For some reason or another sometimes, only sometimes, when you select a RadioButton in the RadioGroup it doesn't highlight as if it's selected but through some tests I've determined that it really IS selected even though it isn't highlighted. Another odd thi...

Sygic CFI doesn't run on Android Platform!

I use avd(API Level 4) run Sygic Application that I request from Sygic.com for testing. I try to write CFI to control application (put .in file in '/sdcard'), but I cannot find any .out and it doesn't run.Please help me. ...

Android: Programmatically animate between images in Gallery widget

I'd like to programmatically move between images in the Gallery widget, with animation. I can change the currently displaying image using the setSelection(int position) method, however that does not animate. Then there's setSelection(int position, bool animate) but the extra boolean on the end there doesn't appear to do anything. In th...

Android Dev.: How to populate gallery by image URL?

I'm trying to build a gallery where the images within will be pulled from the images URL from a website. i.e. Instead of doing R.drawable.xxxx.jpg, you use a url to represent the image. Is this possible? If so, can you show me an example in code? Thanks ...

res file not found exception

Hi, I am getting this "java.io.FileNotFoundException: res/drawable-nodpi/background.xml". But I do have a file in $ ls -la res/drawable-nodpi/background.xml -rw-r--r-- 1 michael staff 859 Mar 8 09:28 res/drawable-nodpi/background.xml E/AndroidRuntime( 301): Caused by: java.io.FileNotFoundException: res/drawable-nodpi/backg...

Android ViewFlipper + homescreen animation

I am trying to use a ViewFlipper and make it act like the home screen(The layout will move with your finger). Check out this for an example. I want to do this with a ViewFlipper that only contains two children so the opposite view should be shown on either side of the current view depending on which way the user moves their finger. This ...

Simple example of <merge> and <include> usage in Android XML-layouts.

I'm curious about the <merge> and <include> tags in Android XML-layouts. I've read two tutorials, but haven't yet found a simple example usage. Would be happy if someone could provide such an example or give a pointer to one. ...

How to register an application as a Home alternative

I'm building an alternative Home application (a replacement of the standard launcher). There's something I don't know how to make : how do you register your application so that it is called when the user click on the Home hard button ? ...

Android TextView's Background Not Moving When TextView.Padding Changes

I have a TextView that I created in the main.xml. In my app.java I am dynamically positioning that TextView based on where the user taps the screen. The problem I am having is that when I call myTextView.setPadding(100,100,0,0), it moves the actual Text of the TextView, but does not move the Colored Background of the TextView. Ideas? ...