android

Having Multiple spinners in android

Can anyone please tell me how to add multiple spinners with only one onItemSelected(). Right now i am doing something like this: Spinner s[] = new Spinner[5]; I am using this for displaying hierarchy in spinners. For index = 0; it works fine. But problem arises with next index as there is only one onItemSelected(). What can you suggest...

Drawing chart in a dialog

Hello all, I have a conceptual question to ask: I created a custom dialog (extends Dialog) and I want to draw a chart (dynamic data, not static) in the top third of the dialog. What's the best (only?) way to approach this? A) Get a canvas to the dialog and draw to it? Seems like I need access to the dialog's draw, yes, or can I do th...

Android proper use of setId()?

I have a series of activities that share a database. In the primary activity the user will be doing things will the program automatically logs data into the db. This continues until the user would like to view the database by starting the view database activity. How I have it set up is that onPause will close the database so the the DBVi...

Sizing an Android multi-line TextView

I have an Activity where I want to display a heading that takes up the top quarter of the app and displays a dynamic set of text. In some cases it'll all fit on one line and I'd like the font size to get sized up so it's large and easy to read. In some cases it'll be on multiple lines (usually less than 4) and need to be smaller. The co...

android to django - how to authenticate users

Hi all I'm trying to get json data from a django view (login required) into a new android app I'm working on. I would like to authenticate the user against the django login and keep the cookie/session for all the django view calls to get data from the server. I did some googling but nothing helped me, even if I guess it should be a q...

Custom Animation Object for Transition in Android?

I want to override the default activity transition in Android with something a bit fancier. What I want to do can't be done with the XML set that one would typically use, so I can't use overridePendingTransition because it only accepts integer references to XML-based animation resources. What I'd like to do instead is create my own obje...

Android - prevent duplicate activities

Hey all So, I'm both new to Java and to creating android apps, but not new to programming. I've read through most of the developer.android.com site, but I haven't been able to find this: I want to make sure that a certain activity isn't running more than once at the same time. So we have a task somewhat like this: Activity A) a TabActi...

android Searchable dictionary results are not being shown in global search

Hello, I have tried to implement the searchable dictionary sample app. Everything seems to be working except when I try to pull the results from global search. I have tried to follow everything that has been described in the docs too. My searchable.xml <searchable xmlns:android="http://schemas.android.com/apk/res/android" andr...

Dom parsing in android

Hi all, i have parsed xml using dom parser,but when the xml element contains no value it throws null pointer Exception.how to check this?... here my code NodeList TrackName1 = fstElmnt2.getElementsByTagName("Artist_Name"); Element TrackElement1 = (Element) TrackName1.item(0); TrackName1 = ...

Android: draw on a view inside an inflated xml (another view)

I have a small xml file called 'xmlview.xml' which is something like: <tablelayout> <tablerow> <view id="view1" /> I created a class which extends view, and I inflated that xml file and now i have a view obtained due to inflation. xmlView = layoutInflater.inflate(R.layout.xmlview, this); I am wondering is there a way to dr...

Problem with overlapping views?

I am writing an android application and am having problems with overlapping views. My layout is <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView ... /> <EditText ....

android connectivity with php-mysql using web services

hey guys i am developing a final year location-based project(gps) in android.I have to create a server using php and mysql which contains name and location(in latitude and longitude) of important hospitals in Mumbai.The android client should be able to retrieve the the latitude and longitude of locations in mysql(external) database and t...

how to display button when menu button is pressed in android

hi friends i want to pop up a button from the bottom of my screen when the default menu button is pressed on the android key pad. i want to navigate from that pop button to other screens. ...

how to change the color of an image but can still recognize the object?

The title maybe a little vague, let me give you an example: if we change a colorful image into black and white, we still can recognize the objects in it. My question is, can I change the color to RED or GREEN or other color rather than black and white in programs(I prefer Java). [Update] : what I want to do is just like this question: ...

Application for different versions and different resolution

Hi Friends/Experts, I am in middle of learning application development. I have created an application in 2.2 and tested that in my HTC Nexus One device. I looks like fine. My client testing same application setup in his device (Droid2). I don't have that device to test. He said there are some font sizes are vary and button alignments...

Android: Is there any way to directly configure a menuItem to startActivityForResult instead of startActivity?

I know I can do this: menu.findItem(R.id.menusettings) .setIntent(new Intent() .setClass(this,SettingsScreen.class)); Which is equivalent to this in a callback: Intent myIntent = new Intent(); myIntent.setClass(this, SettingsScreen.class); startActivity(myIntent); But is there any way I can issue a startActivityForResult with a s...

displaying nearby schools and airports in google maps android

I want to display the near by schools and airports and their related information in the google maps. I have considered using google places api but the registration process for Adsense and Google Places API will take long time. So, is there any other alternative to my problem...??? Any suggestions are welcome !!! ...

How to view .xml output on the go? (Android App-building help)

Hi, I'm a newbie Android App Developer, also new with xml. I was just wondering if there is an easier way to view xml output other than using eclipse to compile the android application (java + xml) and then see output in the android emulator. Just asking because it takes forever to check my UI through eclipse IDE to turn on android emul...

best practice for providing multiple android application themes

i'm trying to work out how to organize an android application that will have multiple themes. here's a simplified example of my problem, 2 themes, "light" and "dark", within each theme, two text colors: "enabled" and "disabled" now the problem is that when i define my TextView, i don't want to call out "light" or "dark" there, i want t...

Creating a multi-table SQL database in android

I'm trying to create a multi-table database for my android application. I'm following the suggestion given on this site http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html for doing it. I keep on getting the error below. The error seems to be cause by the onCreate of the databaes tables. If you look at...