android

Alternative to AbsoluteLayout in Android?

If AbsoluteLayout is deprecated what can I use instead of it? I've done an app that uses AbsoluteLayout but it doesn't work well with the different screen resolutions. I use because I can set the X and Y position of a button. Can I set the position of a button using another layout? ...

Wrapping try-catch that fetches from internet, in a while

So I have a try-catch statement in a java program that fetches things from the internet. How do I handle timeouts? Would I just wrap the try catch in a while statement and after some number of failed iterations tell the user to try later? ...

Android - Any way to access an Overlay's canvas in another class?

While this may sound backwards, I have a need to draw to my Overlay in another class. I get a bitmap from the MapsView, then essentially draw it on the overlay. I am having difficulty doing this however. Here is what I am doing. First I generate a bitmap from the mapview: Bitmap bitmap = Bitmap.createBitmap(400, 800, Bit...

Live wallpaper animation force closing when I add more than 10 frames?

I'm trying to make a simple livewallpaper out of a series of boot animation .pngs... I'm using private static final int NUM_RES = 9; private final Bitmap[] mPics = new Bitmap[NUM_RES]; CubeEngine() { Resources res = getResources(); for (int i = 0; i< NUM_RES; i++) { int id = res....

Alternative to having to select device every time I run an Android application?

Is there some way to have Eclipse NOT present the Android Device Chooser dialog every time I run the Android application I'm developing? I'm using a running Android device, not an AVD. There's got to be some place I can set my default device to be the Android device so that I don't have to double-click on the device entry in the ADC di...

Android - Image button size help?

My imagebutton code wont respond to "fill_parent" and "wrap_content". Instead, it just shows the middle of the image (because it is a pretty big image). I tried setting specific values for the image but it still didn't work! Can somebody help me? My button.xml in the res/drawable folder: <?xml version="1.0" encoding="utf-8"?> <selector...

Options for Sharing Android App Data on Multiple Phones

I'm looking for suggestions for ways to share Android app data between phones running the same app. For example, lets say I have an app that stores a database of book reviews. If person A has a book review that person B doesn't have, what are the options for getting that information from person A's phone to person B's phone? Currently, ...

Listview from multiple tables?

I'd like to populate a listview from 2 tables. Anyone know how I can achieve this? Currently what I have looks like but it only works with one adapter: private void populate() { todoCursor = dbNotes.getTodoKey(); startManagingCursor(todoCursor); todo = new SimpleCursorAdapter( this...

AutoCompleteTextView adapter not displaying dropdown?

Here is my onCreate method: /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); if (intent.getData() == null) intent.setData(Formulas.CONTENT_URI); Au...

What is the Easiest way to stop a soundpool of 4 streams

What is the Easiest way to stop a soundpool of 4 streams. mSoundManager.addSound(1, R.raw.svphorn); mSoundManager.addSound(2, R.raw.svpphaser); mSoundManager.addSound(3, R.raw.svpwail); mSoundManager.addSound(4, R.raw.svpyelp); I need a button to stop all sounds playing @ one time. ...

checking for a subset in android application

So I have an array of strings (let's call it array1) and then I have another array (array2 say) and I want to check if array2 is a subset of array1.. is there a simple command for that? edit: scenario2 I have array1 (which is user generated through an edittext with strings say names of people) and I have a matrix that I want to check ...

Error Creating Table on Android

I'm trying to create a table in android database, but when i try to run the application the LogCat returns the following error: 08-22 02:39:29.098: ERROR/AndroidRuntime(277): Caused by: android.database.sqlite.SQLiteException: near "auto_increment": syntax error: CREATE TABLE words(id INTEGER PRIMARY KEY, word TEXT, count INTEGER not nu...

Rotating views in a LinearLayout problem.

I have a LinearLayout with a vertical orientation, within that layout I have three buttons (ImageButtons to be exact) and when the orientation changes (via an OrientationEventListener) I have them set to perform a rotation animation. The top and bottom buttons rotate perfectly, however the middle one does not. Its pivot point seems to ...

Get co-ordinates touch screen in a background service.

Hi. I'm just wondering to know if a can with a background service have co-ordinates of a touch screen event in all activities. Such like that *final TextView textView = (TextView)findViewById(R.id.textView); final View touchView = findViewById(R.id.touchView); touchView.setOnTouchListener(new View.OnTouchListener() { @Override p...

Android : Network operations in Appwidget

Hi, I'm developing a Android AppWidget for my application. For updating my appwidget I need to download data from network. But when I try to do that in onUpdate method, my appWidget is killed by Android system. I learnt that time consuming operations can't be done in receivers so I launched a service from onUpdate method and launched a t...

How to increment field in sqlite android database

Hey, I want to increment a column in a sqlite android database. Im doing like this: public void atualiza(String word){ this.db.rawQuery("UPDATE words SET count = count + 1 WHERE word= ? ", new String[] {word}); } And I call this method on another class like this: this.dh.atualiza(word); But when i pull the database from t...

Android not loading app

I am going through the Android Hello World, but when I go to Run > Run in Eclipse, it loads the emulator, takes a few moments, then loads the Android home screen. My app does not load automatically like the tutorial says, and I can't find it in the applications list. How do I get my app to launch? What might I have done? I am using Ecl...

Android TextView and how to determine the number of visible characters

How can I determine the number of visible characters that a TextView can display. For example if I change the orientation this number may change. If I change the resolution then also the number of visible characters changes. Thanks in advance ...

How to display non free applications on an android phone ?

On mine it only displays free apps... Is there a country related problem ? ...

How to prevent ListView from updating while item is long pressed?

I have a ListView which is updated by some service sending intent. If update event arrives while I'm pressing some item in the ListView I get some weird behavior. The default orange rectangle in the pressed item disappears and some other item(s)'s text becomes darker (as if its item is being pressed). How do I postpone ListView update ...