Android Development

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

API Demos

Hi,

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,
marco

"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?

Thanks.

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:

OnCreate:

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.


PS:

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?
Thanks

How to finish my application?

hi,

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);
startActivity(i);

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?

Greetings,
Marco

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

Hi,

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));
emptyListTextView.setId(android.R.id.empty);
emptyListTextView.setText("Empty"
userListView = (ListView) findViewById(android.R.id.list);
userListView.setEmptyView(emptyListTextView);

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.

Regards,
Prashant

Help changing Activities/Screens

Hi!

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.

Thanks!

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

hey
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(R.id.txt);
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

normal
#default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/icon60.png

highlight
#default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/icon52.png

1.1

http://maps.google.com/mapfiles/kml/pal3/icon52.png

1.1

http://maps.google.com/mapfiles/kml/pal3/icon60.png

1065 Brea Mall, Brea, CA 92821

1065 Brea Mall, Brea, CA 92821

-117.883593
33.916991
0
1000
0
0

#default_copy0+nicon=http://maps.google.com/mapfiles/kml/pal3/icon60.png+hicon=http://maps.google.com/mapfiles/kml/pal3/icon52.png

-117.883593,33.916991,0

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