android

How to handle feedback from background threads if the user uses the back button?

I have the following problem: I have an Activity where a user can start a web search showing a new activity to show a progress bar until the results are shown. Now the user can either wait for the results or maybe think about the search parameters, hit the back button and triggering a new search. The search is running in an Async Task ...

what are the file formats can android video player supports in android?

what are file formats android video player can support in android? and differentiate the video view and video player in android.. i am looking on the tutorils, videos, forums answer, etc. anything related to this... ...

FileNotFoundException while trying to convert contacts to Vcard

Hi I m trying to convert the contacts on emulator to VCard format using the code below AssetFileDescriptor afd =openAssetFileDescriptor(Contacts.CONTENT_VCARD_URI ,"r") The stack Trace says java.io.FileNotFoundException No file at content://com.android.contacts/contacts/as_vcard Do we need to attach a file to the URI ? Is there som...

Android Application: Got Internet Connection

Hi, How can I check got a successful internet connect (Wifi/3G/whatever else) I already display an error to the user if they don't have Wifi connection but how can I make sure then that the user does got 3G connection if they wish to connect to use the application without the Wifi connection? ...

What's wrong with debugging in Eclipse on Android?

I've obviously been spoiled by Visual Studio, because although I'm just learning Android and the Eclipse environment, debugging apps in Eclipse is becoming a serious detriment to further development. For example, Eclipse will compile this divide by zero just fine: public class Lesson2Main extends Activity { /** Called when the acti...

Image not on SD Card

Hi - I've got a camera application and when I take a picture the image is stored. However I cannot see it on the SD Card until I reboot the device. Any ideas why? My code is as follows. Also when I view the image as a bitmap in my activity (After restarting) the picture is flipped the wrong way around. Any ideas about that? Camera.Pic...

Permission denial to read from emailprovider in android

Hello Everyone, I've the problem when I want to read "com.android.email.provider" to get email accounts. Here is my code to retrieve the account : Cursor c = null; Uri CONTENT_URI = Uri.parse("content://com.android.email.provider/account"); String RECORD_ID = "_id"; String[] ID_PROJECTION = new String[] {RECORD_ID }; c = getContentR...

Problem when trying to connect to a desktop server from android on wifi

Hello, I am trying to send a file from the phone running Android 1.5 to a server on a desktop. I wrote some code, which works on emulator, but on the phone it doesn't. I'm connecting to the network through WiFi. It works, I can access the internet through my phone and I've configured my router. The application stops when I'm trying to co...

Launch Google Maps app

Hi, I'm trying to launch Google maps from my application. I'm using: GeoPoint center = _mapView.getMapCenter(); Uri uri = Uri.parse("geo:"+center.getLatitudeE6()+","+center.getLongitudeE6()); Log.d(LOG_TAG, "Launching Google Maps with Uri: ("+uri+")"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); ...

Android - Redirect sending of SMS message

I currently use a ContentObserver to listen for changes in the SMS ContentProvider and tell my application whether a message has been sent or received. Upon getting notification that a message is being sent I would like to present the user the option to send that SMS normally over GSM/CDMA or if connected to Wifi to send the SMS over an...

NullPointerException in ItemizedOverlay.getIndexToDraw

I have a relatively simple MapActivity that I'm trying to make display a list of "camps" within a given map region. I've created a custom subclass of OverlayItem called CampOverlayItem, a custom ItemizedOverlay called CampsOverlay that returns CampOverlayItems, and of course a MapActivity subclass that populates the map. I'm pulling the...

how to clear all map overlays or markers from google map in android?

I want to clear all map overlays or markers from google map and using following code if(!mapOverlays.isEmpty()) { mapOverlays.clear(); } which is giving me exception can any one guide me? am i right or wrong if i am wrong then kindly provide me the solution to my problem. i want map clean if there is any marker on it. an...

Convert JSON String to Java Object or HashMap

Hi. I am writing an android app. I want to pass some data across the intents/activities and I feel that a conversion to and from JSON is probably a more optimal way at this point. I am able to convert a java hashmap to a json string successfully using JSONObject support. However i need to convert back this JSON string to a java object ...

AvoidXferMode Tolerance

I have a problem with the following code: protected void onDraw(Canvas canvas) { Paint paint = new Paint(); // Draw a blue circle paint.setColor(Color.BLUE); canvas.drawCircle(100, 100, 50, paint); // Draw a red circle where it collides with the blue one paint.setXfermode(new AvoidXfermode(Color.BLUE, 0, Mode.T...

Android Activity is displayed after user unlocks the screen

Hi, I was wondering if anyone understood how to make your application be displayed when you unlock the screen. I have an application where the user turns on a Bluetooth device, it connects to the phone, and the user should be presented with a UI. Having them hunt for the app or using the notification menu is not a workable option (too m...

Android: AdWhirl cannot find AdMobAdapter

Using AdMob by itself works perfectly. Using AdMob through AdWhirl causes the following problem: 23114 dalvikvm I Failed resolving Lcom/adwhirl/adapters/AdMobAdapter; interface 144 'Lcom/admob/android/ads/AdListener;' 23114 dalvikvm W Link of class 'L...

I want to know how to change dynamically a ListView's item layout.

I want to know how to change dynamically a ListView's item layout. To be exact, i want to know the method that the ListView's bindView method is called at runtime. if the bindView method is artificially called by a other method. then i will change a ListView's item layout. Please let me know. ...

Android -- How to position View off-screen?

Hello all, I'm trying to animate a simple ImageView in my application and I want it to slide in from the bottom of the screen and come to a resting position where the top 50px of the view is off the top of the screen (e.g. the final position of the ImageView should be -50px in X). I've tried to use the AbsoluteLayout to do this, but thi...

Adding visible "Markers" to represent Geopoints to a MapView using ItemizedOverlay in Android

Hello, I am building an application which stores GPS locations in a SQLite database and then outputs the data onto a MapView using an Overlay by drawing a red line between the points. I want to be able to show graphical markers (images) for each of these points as well as the red line. My code is as follows: public class MyOverlay ex...

Programmatically Writing PCM WAV Data in Android

Hi, I'm looking for a way to programmatically save an array of shorts as PCM data. I know that this should be possible, but I haven't found a very easy way to do this on Android. Essentially, I'm taking voltage data, and I want to save it in PCM format. My function looks something like this: public void audifySignal(short[] signal...