android

xml vs java LinearLayout fills

the xml version below properly handles height and width and the java doesn't what is the java missing? xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="horizontal"> <...

OpenGL ES 1.1 vs 2.0 for 2D Graphics, with rotated sprites?

I am having trouble finding information related to which i should choose, OpenGL ES 1.1 or 2.0 for 2D graphics. OpenGL ES 1.1 on Android is a bit limited to my knowledge, and based purely on sprite count the only useful renderer is draw_texture() (as far as i know). However, that does not have rotation and rotation is very important to ...

Android, NetworkInfo.getTypeName(), NullpointerException

I have an activity which shows some List entries. When I click on a list item my app checks which connection type is available ("WIF" or "MOBILE"), through NetworkInfo.getTypeName(). As soon as I call this method I get a NullpointerException. Why? I tested this on the emulator, cause my phone is currently not available (it's broken...)...

getLine1Number return null but not always....

I use the telephony manager to get the phone number, in the sdk all works perfectly, on some devices like my hero with 1.5 it returns null, on the tattoo with 1.6 it works but on some other tattoos it returns null... I start to get crazy... why is this happening? Is there is another way for get the phone number? ...

Android which button index from array was pressed

How do I set up a OnClickListener to simply tell me which index button was pressed from an array of buttons. I can change text and color of these buttons using the array. I set them up like this. TButton[1] = (Button)findViewById(R.id.Button01); TButton[2] = (Button)findViewById(R.id.Button02); TButton[3] = (Button)findViewById(R...

Use of SAX parser in Android - OutOfMemory Issue

Hi everybody, I have been using a SAX parser for a while now to get data from various XML, but today i'm banging my head on a new problem with a hudge XML (compared to the previous ones . here around 12k lines) with a lot of repetitive items in it. Most of the time, the items are part of a block : <content> <item lbl="blabla"> ...

Naming my application in android

Hi, I think i'm getting senile because I was convinced that to give a name to your application, you had to fill this part of the manifest : <application android:icon="@drawable/icon" android:label="MyApplicationName"> However for a reason I don't understand, my application gets the name of my first activity, in which I load data, he...

where can i find some android web page templates, css or html to use as a starter page

In searching the web I came across http://groupaware.mobi/iphone which has a sample iphone navigation site. Is there someplace I can find a similar thing for android? i.e. sample web pages with css, sample templates, navigation etc. If not, what suggestions would you have to offer to someone looking to build a web page for android? ...

Better way to generate tiles

Hi ! I'll start by saying that i'm REALLY new to OpenGL ES (I started yesterday =), but I do have some Java and other languages experience. I've looked a lot of tutorials, of course Nehe's ones and my work is mainly based on that. As a test, I started creating a "tile generator" in order to create a small Zelda-like game (just moving...

Does the Android API support KML files?

Is there a way in Android to load KML files from Google Earth into a map widget? Specifically I am looking to load saved shapes created in Google Earth overtop a map widget as easily as possible. Has anybody ever tried this before? ...

want a dev branch to run on phone along with live version (android)

I have a live marketplace version of my application, and now want to start developing my next version, but want to be able to have the newer dev 'upgrade' (for testing) and existing live version (for demoing) both on the same device, but I dont want to create a whole separate project to do this. Any ideas? ...

New Bluetooth API question

I have written a small app that puts my bluetooth in discoverable mode for a long time (G1 - API 1.6). I use that along with small program on windows to lock/unlock the computer if the phone is close by. Recently i try to port this app to my nexus one but it seems like i have to pop up the message every 300s to enable device to go to dis...

Not able to update contact name in emulator 2.1

Hi, I am tring to update name of existing contact in android 2.1 emulator with the following code but always getting "java.lang.IllegalArgumentException: Emplty values" Exception. ContentValues contactValues = new ContentValues(); contactValues.put(People.NAME, "rishabh"); getContentResolver().update(UpdateContactUri, contactValues, n...

options menu in android application

hey … i want to open up options menu by clicking upon my own created button … is it possible ? if so, please help me out … thanks in advance ...

Project Android Screen with DroidEx

Hi ! I am using Mark Murphy's DroidEx tool to project my android device screen; is there a way to supply a skin(e.g. a HTC Hero skin that we use with Android emulator) to DroidEx? I have also asked this question on the google group for DroidEx project. Thanks! ...

How to handle runtime exception on playing audio files?

I have a button that plays an audio file on its click listener. If the button is clicked again and again while the audio file is being played then the app crashes. What's the solution? Here is some code for reference: private OnClickListener btnMercyListener = new OnClickListener() { public void onClick(View v) { ...

What do I have to add to a layout to hide the titlebar?

I want to hide the titlebar of my app in some of my views. What do I have to add to the layout files I want to hide the titlebar in? Can you provide an example? ...

Deactivate any calls to Log before publishing: are there tools to do this?

According to Google, I must "Deactivate any calls to Log methods in the source code" before publishing my Android app (section 4 of the publication checklist). My open-source project is large and it is a pain to do it manually every time I release. Additionally, removing a Log line is potentially tricky, for instance: if(condition) L...

Android RatingBar change star colors

How can i change the star colors and how can i change the size of the stars ? ...

Getting contacts when ids are known

Hi, I have a list of 'n' contact ids corresponding to which I need to obtain the contact details. One simple way to make n queries using the contact ids and retrieve those contacts. But this will be very time-consuming especially if n is large. I would like to know if there is any simpler way to obtain these results (like batch query et...