Android Development

A place to discuss Android Development, Eclipes, the SDK, Java, xml and souch issues.

API Demos


the API Demos have a very simple layout. it's just buttons one below the other, with no border and just small lines as separator.

how can I just do this? which layout? which properties for the buttons?

thanks & greetings,

"Application run error" is encountered when trying to load large image file

I have encountered "Application run error" when trying to load large image file (eg. > 2 Mbytes) for display using XML structure programming (e.g ImageView). Is this a known constraint? Any suggestion to workaround this?


application logic help

Application logic help
Hi all,

I'm writing an app that connects to a server, parses the data and prints the output to the app window. The problem I'm having is I can't find a way to write to the TextArea once I start receiving data from the server.

My current set up is like this:

Main class:


Initialize some variables, load the layout from /res/layout and make a new Thread which starts a new Server connection thread and runs it.

Server class:

Connect to the server, and get the output. Show the output in Log.d and try to write to the TextArea created by the Main class using a class called write(String msg) inside the Main class.

Trying to do it this way throws exceptions. There must be a better and easier way to do this and I would appreciate any help put forward.


I'm also try different layouts, if someone could give me some ideas for how to go around making my app look like this, I would also appreciate it.

How can I create a ComboBox?

How can I create a ComboBox in Android application?
Please, can you give me an example or link?

How to finish my application?


I'm new to Android. I've got 3 Activities (3 .java and 3 .xml files).

I'm using Intents to switch to the next view.

Intent i = new Intent();
i.setClass(BetsActivity.this, LoginActivity.class);

I've got a context menu with the option to close the application.

But calling finish() just closes my view and switches to the last view (like a back button).

How can I close all my Activities at once?


The list view empty view is not shown (SDK m3-rc37a)


I am using a listview and I have setup the empty view for the list view as follows:

TextView emptyListTextView = new TextView(this);
emptyListTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
userListView = (ListView) findViewById(;

but nothing appears when the list is empty. I have not defined the empty view in the xml file, but am adding the empty view like above.

Please help.


Help changing Activities/Screens


I'm new to Android development, but already a great enthusiasth! I read all the Google's Notepad tutorial, but I'm still having some trouble trying to make my app change its screen. I designed two different classes and respectives XMLs, one for each screen. I wrote some code very similar to the one on the tutorial, to create an Intent that would launch the other activity with the new screen, but it just isn't working. Any help on that? Can someone please post an example of how should I proceed?

As soon as I can make something usable, I'll post my app here!!!

Thanks a lot in advance!

How to set envirnment variables accessible by android application

Hello everybody,

I am a newbie of android and i would like to ask if anybody knows how/where i can set environment variables that can be accessed through an android application.


Help with the getExtra method

im using the below code :

Location loc = (Location)intent.getExtra("location");
Double lat = loc.getLatitude()*1E6;
Double lng = loc.getLongitude()*1E6;

but than i got the warning that the method "getExtra" is deprected ... can someone know how to convert this code to the new code ?
Thanks !

using KML file

im trying to use a kml file as a location provider and my lat and long is always 0 ,
the code is:

LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location myLocation = locationManager.getCurrentLocation("gps");
TextView eText = (TextView) findViewById(;
eText.setText("Current location is: lat: " + myLocation.getLatitude() + " long: " + myLocation.getLongitude());

the kml file is:
<?xml version="1.0" encoding="UTF-8"?>

1065 Brea Mall, Brea, CA 92821.kml





1065 Brea Mall, Brea, CA 92821

1065 Brea Mall, Brea, CA 92821




my properties file is:

requiresNetwork false
requiresSatellite false
requiresCell false
hasMonetaryCost false
supportsAltitude true
supportsBearing true
supportsSpeed false
repeat true
accuracy 100
powerRequirement 1

and i put the permission in the AndroidManifest.xml file are:

and i dont have any other file in that directory beside the "kml" file and "properties" file
and i tryed to stop the adb.exe and start the emulator again (like i saw in the thread above that solve this problem)
does someone know what is the problem ?
Thanks !

Syndicate content