android

Android: is it possible to have multiple separate Canvas layers, which I can merge to one?

Is it possible to have multiple separate Canvas layers, which I can merge to one? Similar to what I'd do in photoshop? Update: Some explanation why I'd like to have something like that: Layer1 might hold something that has been created by a complex and CPU expensive algorithm while the other layer, Layer2, is something that just goes...

Android SQLite database

I have application working with SQLite DB(table with two rows) I need to recieve _ID row of the selected listview Item, but don't know how to do it. So, main activity public class Main extends ListActivity { private RecipesData recipes; private static int[] TO={0,R.id.row_text_id}; private static String[] FROM={ _ID, CATEGORY_NAME, }; /...

Problem checking for network connectivity

I have an IntentService which makes some web service calls. Before making these calls I check to make sure the device has network connectivity. I am doing so like this: private boolean isOnline() { ConnectivityManager connec = (ConnectivityManager)getSystemService(getApplicationContext().CONNECTIVITY_SERVICE); return connec.getN...

Deleting SMS Using BroadCastReceiver - Android

i have broadcast receiver class for receiving sms, but i dont know how to delete the received sms before reaching to the inbox as well as the notification public void onReceive(Context context, Intent intent) { Bundle pudsBundle = intent.getExtras(); Object[] pdus = (Object[]) pudsBundle.get("pdus"); S...

Yet another Android SQLite database question

I want to create two tables in DB, how do I do it using SQLiteOpenHelper descendant and overriding onCreate metod? Will the below code be ok? Seems I'm doing it wrong. public void onCreate(SQLiteDatabase db){ db.execSQL("CREATE TABLE "+CATEGORY_TABLE+" ("+_ID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+ CATEGORY_NAME+" TE...

Least Expensive Android Phone for TTS SW Development?

I know many developers ask about the best Android phone for development, but my question is almost opposite: What is the least expensive Android phone that I can get away with TTS (text-to-speech) and ASR (automated-speech-recognition) software development? To further clarify my question: Do all Android phones support TTS and ASR? Do ...

IntentService getting wedged

I've built an application which uses an IntentService for manipulating the application's database and calling web services. Example: I have an Activity which is a list of items. This list is populated by a CursorAdapter. Each item has a checkbox and the list is ordered by checked (unchecked items on top and checked items on bottom). ...

How to draw animation on a canvas ?(android)

I am trying to show an animation on a canvas when user touches to the screen.I know basics and how to draw a bitmap on to canvas but i couldn't find anything good on drawing or showing animation on canvas.i will use frame by frame animation and it will appear at the same position user touched that is why i can't use ImageView. ...

android audiomgr standby gets called

I have some code which streams audio from a server. It seems to work as expected for exactly 90 seconds and thereafter stops with the following three lines in the logcat - D/AudioHardwareMot( 1052): AudioMgr:AudioStreamOutMot::standby called D/AudioHardwareMot( 1052): AudioMgr:Output 0xb538 entering standby D/AudioHardwareMot( 1052): A...

Problem temporarily disabling a EditText field

I'm trying to create an activity which gets input in the following form: () Option 1 (a RadioButton) () Option 2 (a RadioButton) () Custom (a RadioButton) [ ] (a EditText) The idea is that the user can either choose one of the two predefined values, or enter a custom value. In order for him to enter a custom value, he mu...

From whence cometh Enum.values()?

I was looking through the documentation and source code, because I wanted to be certain that values() would always return an array in the order in which the Enum values are declared. Turns out, it's not in the documentation as far as I can tell. I checked the source code for the Enum class, and no luck (there is a related, private "get...

TextView getting highlighted after using linkify or autolink

I have a long text message followed by a link and have put this inside a TextView. It's simply like this: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:orientation="verti...

Android SQLiteDatabase Null Pointer Exception

Hi! I've just started developing for Android. So far it's been surprisingly smooth sailing, but now I've run into some problems implementing an SQLite database. My code is based on Google's Notepad example (which runs perfectly well), but I keep getting Null Pointer Exceptions thrown at me and it seems to be related to the getWritableDa...

Is it possible to add an array or object to SharedPreferences on Android

If not, is there any workaround? I have an array list of objects that have a name and an icon pointer. I do not want to use a database. ...

Android : acces to Canvas without inheritance

Hi all, I want to draw in a view/layout, but I don't want to have to inherit from Layout, ( in order to have the onDispatch(Canvas canvas) method). I want to draw bitmap over my main application, but without losing focus (so i cant run an activity to draw on screen). I had a solution that was working but I had to inherit from LinearLayou...

Android - How can I make a horizontally-scrolling ListView?

Like many things in Android, you wouldn't think this would be such a hard problem but ohhh, by golly, would you be wrong. And, like many things in Android, the API doesn't even provide a reasonably extensible starting point. I'll be damned if I'm going to roll my own ListView, when all I want is to take the thing and turn it on its sid...

Target only fast Android devices in the Market

I've been looking for a way to only show my game to "fast enough" phones in the Market but I can't find any good answer. Some people suggest to target by SDK, but that has nothing to do with the speed. I've seen some to target by screen size, but some Acer phones and the HTC Legend are fast enough for my game but have the same screen t...

getting authToken of a Google Account in Android

Hi, I am trying to model an app based on http://code.google.com/p/jumpnote/ authBundle = am.getAuthToken(account, APPENGINE_SERVICE_NAME, needAuthAction == NEED_AUTH_NOTIFICATION, null, null).getResult(); authToken = authBundle.getString(AccountManager.KEY_AUTHTOKEN); authToken is returned null in this case. ...

finish() not finishing my activity.

Hi, in my Android app I've got two activities, lets say A and B. A is the main activity, and it calls Activity B like so: Intent myIntent = new Intent(getBaseContext(), B.class); A.this.startActivity(myIntent); And this works fine. The back button on the phone works to return to activity A, but I want to put a button on the UI as well...

Android: MediaPlayer gapless or seamless Video Playing

I can play the videos fine back to back by implementing the OnCompletionListener to set the data source to a different file. No problems there. I call reset() and prepare() just fine. What I haven't been able to figure out, is how to get rid of the 1-2 second gap screen flicker between the data source change and the new video starting. ...