android

How to detect if any of my activity is front-most and visible to user?

I would like to launch an intent when any of my activity is visible, otherwise I will put it up as a notification, and will be fired by the user. To decide this, I need to know if any of my activity is front-most, how do I that? ...

How to do an app with truly multilingual strings?

Hi, what should be the best approach to make strings for different languages? I have this problem, I am trying to display strings such as 'month', 'months', 'year', 'years'. Currently I am working on 3 languages I know: spanish, english and polish. For english and spanish this is straight forward. But for instance, in polish 'years' can ...

How to pass a SortedSet as an Intent's extra?

I have a service that produces as result a SortedSet object. I need to pass it to another Intent that will use it. First is put in the notification area, then when the user actions it it will need to fire the activity. As it it's own SortedSet is not Parcelable nor Serializable so it won't work. One single item in SortedSet is already p...

Android SSL JNI structure?

Hello, I have been looking at Android's javax.net.ssl package, but am still confused as to how it works with the underlying JNI glue in place. From what I see, all of the classes under the javax.net.ssl package (/libcore/x-net/src/main/java/javax/net/ssl) are abstract and do not directly implement functionality. All of the functiona...

Simulate button press

I have this resource for a Button <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item android:state_pressed="true"> <shape> <solid android:color="@color/CLR_GREEN" /> <corners android:radius="5dp" /> <padding android:left="...

I get frequently SQLiteDoneException when querying one value, why?

I get frequently SQLiteDoneException, 06-29 02:03:34.816: WARN/System.err(30470): android.database.sqlite.SQLiteDoneException: not an error 06-29 02:03:34.816: WARN/System.err(30470): at android.database.sqlite.SQLiteStatement.native_1x1_string(Native Method) 06-29 02:03:34.816: WARN/System.err(30470): at android.database.sqlite...

How do I get a ProgressDialog to show on application Startup?

aka, what is wrong with this code:- package com.mez.appofjaq; import com.mez.appofjaq.RssParser.RssFeed; import android.app.Activity; import android.app.ProgressDialog; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.webkit.WebView; public class AppOfJaq extends Activity { protected...

Android: Separate intents for email & SMS

I have an app that has two buttons – one for email & one for SMS. Depending on the button pressed I want to email or else SMS a certain text. I have coded the email button and it is working fine. The problem is that the dialog box that pops-up gives an option of e-mail or Messaging the text. I want to separate out the two, so that when t...

Android: Looping through pictures and setting each as background

I have about 25 pictures in my res/drawables. I want to loop through them, setting the next one as the background everytime the user hits a button on the screen. Of course the drawables folder also has other pictures like droid icon etc which I don't want to use. Cannot think of a good way of doing it. I thought of naming my pictures ...

How to pass socket, inputstream, outputstream objects between activities

How to pass socket, inputstream, outputstream objects between activities ...

Is a volatile reference a safe way to pass MotionEvents between threads?

I am curious about the safety of this method I have considered using for passing touch events in my Android application (and testing my understanding of concurrency in Java). Here's the basics: I have a SurfaceView hooked up to SurfaceHolder.Callback to get user input events, mainly the onTouchEvent callback. After the onTouchEvent met...

printf equivalent for Android dev?

I'm just getting my toes wet. Using Eclipse, and am not far beyond HelloAndroid. If I have a gallery image loaded onto the screen, and I want to play around with getPixel, where do I send the resulting RGB value output so that I can read it? Thanks. ...

Error with android database program

06-29 01:24:15.882: ERROR/AndroidRuntime(747): Uncaught handler: thread main exiting due to uncaught exception 06-29 01:24:15.922: ERROR/AndroidRuntime(747): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Arrival}: java.lang.NullPointerException 06-29 01:24:15.922: ERROR/AndroidRuntime(747): at and...

Package more than 1 widget in a Android App

So I've been playing around with android app and widgets. have a few things running. but one thing i cant seem to figure out is how to package more than 1 widget. say i wanted to release my set of widgets? where in the manifests can i do this? thanks ...

How to spin an android icon on its center point?

I have written the following to spin my icon on the center of the screen and instead it rotates around the upper-left corner (i.e., origin x=0, y=0 of the ImageView). It should be simple to set some attributes of the ImageView or the RotateAnimation, but I can't figure it out. public class IconPromoActivity extends Activity { priva...

How to avoid MediaScanner delete database entries?

Hi, in Android the system does not scan flac lossless audio files, so I write a scanner to scan them, put into Audio.Media.EXTERNAL_CONTENT_URI, and it works well - until the MediaScanner activates and delete the entries I have inserted. Is there a way to prevent MediaScanner deletes them, or some trick to know when MediaScanner is done,...

how to handle incoming call events in Android

Hi there Does anybody know if there is any event to handle incoming calls?? I'm developing an app that streams audio from the microphone and I would like to have a listener that stops the recording, etc when there is an incoming call...and that restarts the procress when the telephone call is over. Thanks in advanced ...

setcurrenttab from preference

The default tab that is displayed in my app is tab 0. I would like when Preference uso is clicked, to change the currentTab to 1, as well as the next time the app opens, tab 1 is displayed instead of tab 0. This is the Preferences.java contents: package com.fbisoft.uowt; import android.os.Bundle; import android.preference.Preference;...

AsyncTask: Is onPostExecute guaranteed to run after all calls to onProgressUpdate?

Hey all, I would like to know if it is possible to get 'leftover' calls to AsyncTask#onProgressUpdate after AsyncTask#onPostExecute has been called? I am setting text on the same TextView using both of them, and I don't want to set text such as "Done!" and then have it overwritten at a later point by text such as "Almost there - 90%" ...

Supporting /restricting android app only for normal resolution ?

Say if I decided to support only normal 320X480 screen resolution for the first release of my app, Will these lines, hide the app from the high and small resolution screens on android market ? <supports-screens android:smallScreens="false" android:largeScreens="false" android:resizeable="false" android:normalScreens=...