android

Android multiple email attachment using Intent question

Hi, I've been working on Android program to send email with attachment (image file , audio file , etc) using Intent with (ACTION_SEND) . THe program is working when email has a single attachment. I used Intent.putExtra( android.content.Intent.EXTRA_STREAM, uri) to attach the designated image file to the mail and it is wokring fin...

How to return time from AnalogClock/DigitalClock in Android

I need to obtain time from my AnalogClock as a String and pass it as argument in a method. Wonder whats the method of AnalogClock to return current Time. Thank you. ...

How to resolve frequent changes in latitude and longitude

In my application I write the code for fetching latitude and longitude of current location. But it is frequently changing while my device is not moving. How can I resolve this problem? ...

Android - first run preference initialization

I have next situation: After installing application it has to init settings from server. And while itis not has right preferences it has to wait. I have several receivers and service - I dont want to check for initialization in every action in these components - I think there have to be better solution. Can somebody help me with it? :) ...

Handling that annoying "java.lang.IndexOutOfBoundsException: getChars (5 ... 0) has end before start" bug

I get about 50 of these coming from my users each day. I realise that this is a Motorola Droid bug - http://code.google.com/p/android/issues/detail?id=5164 Is there anyway I can catch this error in my code? ...

Zooming on android dev - google maps becomes slower

I've developed a GPS app in which i record the user routes and show it on the map. But panning around on the map when reviewing my route is painfully slow, it takes at least 4 or 5 seconds for the map to respond the finger swipes. I've overridden the onDraw() method and drawing the lines to show the routes whenever we zoom on the map, ...

Problem with AsyncTask on rooted Droid

Hi I've got a widget on the Android market called DigiClock widget, and after the last update i've been having some extremely rare and random problems on rooted Motorola Droids ( there may be other handsets with the problem, but the only responses i've had are from rooted droid users ). The problem occurs when an activity is launched th...

Android : changing Locale within the app itself

My users can change the Locale within the app (they may want to keep their phone settings in English but read the content of my app in French, Dutch or any other language ...) Why is this working perfectly fine in 1.5/1.6 but NOT in 2.0 anymore ??? @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemI...

I want my app to run things in the background, even when the user is donig other things on his Android.

What should I look at to get started? Is it Timer? http://developer.android.com/reference/java/util/Timer.html Or am I missing something else? ...

Failed Binder Transaction when returning camera image

Hi, I get the Failed binder transaction error in the logcat when returning the image taken with the camera from the camera intent back to the parent intent (as a byte[] using putExtra). I don't understand why, its not like its a big bitmap or anything. It only happens when i take pictures with lots of light, because then the byte[] is bi...

how to set the simplecursoradapter to a listview in android?

hi all, i have to set the simpleCursorAdapter into a listView. how can i achieve that? thanks. ...

Remove any private data programatically?

Hi! Is there some simple way to remove any private data (such as contacts, calendar items, media) from Android phone programatically? Thanks, Boris ...

engine for cross-platform layouts like these ones for mindmapping

I want to create a program. Part of its gui is similar to mindmapping or yahoo-pipes (you got the idea). And I want to be able to port this program to Windows, Linux and Android (don't really care about Macs). So can you help me to choose a cross-platform library for drawing and operating such GUI? I haven't chosen the language yet. I ...

Why doesn't my Service work in Android? (I just want to log something ever 5 seconds)

I created a new class called HelloService. I added this to the Android manifest.xml. public class HelloService extends Service { private Timer timer = new Timer(); private long INTERVAL = 5000; public void onCreate() { super.onCreate(); startservice(); } private void startservice() { timer....

Android game loop, how to control speed and frame rate

I've written a game for Android, and I've tested it on the Dev Phone 1. It works perfectly, the speed is just right. However, I'm sure phone CPU's are getting faster. They may already be faster than the dev phone. How do I make sure that my game runs at the exact same speed no matter what the device or how fast it runs? Do you know ...

how to getSharedPreferences in dialog?

dear friends, i want to read file in dialog can any one guide me how to achieve this? when i use SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE); in dialog it gives me error "method is undefined" ...

Why can't I stop a service in Android?

Intent helloservice = new Intent(this, HelloService.class); startService(helloservice); ... stopService(helloservice); Why won't this work? It just keeps running. Am I missing some Binds or something? By the way, this is my service: public class HelloService extends Service { private Timer timer = new Timer(); private long ...

Intent resolution in Android

Hello community, If I want to create custom address book (which overrides my phone's default address book), and if I want it to be used by all applications, what should be my intent filter? Does Android allow me to do such a thing considering the fact that such a third-party app could potentially be malicious?! And, if I want to have ...

playing audio from audio track in android

Hi All, I want to play music from online mp3 link. I am reading the music data into a stream and trying to play it using audio track. But itz giving only noise.No music i could listen. This is my code. int intSize = android.media.AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, ...

How can I get longitude, latitude of phone in Android?

I read some tutorials online, and found that LocationManager does this. This is the code I found online. However, I don't get it. Why can't I just get the long/lat? Why go through all the "change" location things... lm=(LocationManager)this.getSystemService(LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDE...