android

Intent filter and diffrent extra's

Hi all, I have one activity in one application, which suppose to run another activity in another application, while passing to it an arguemnts|(Through putExtra) the problem is" that i know that I must add something like: Intent i = new Intent(target); i.setAction("actionstring" + System.currentTimeMillis()); to the target intent(act...

Android ImageButton setImageResource from variable

I want to setImageResource for an ImageButton programatically, based on a variable. For eg: if size=5, I want to setImageResource to R.drawable.five if size=6, I want to setImageResource to R.drawable.six Unfortunately, I have too many of these, so an if-else or switch gets tiring. Is there a way to achieve something like: R.dr...

intent-filter not working

One of the activities in my app has an intent-filter with: Action - VIEW Categories - DEFAULT BROWSABLE Data - scheme is 'myapp123'. I want to start this activity from another application using the Intent but I get NoActivityFoundException. Even if I type myapp123:// from the browser, it doesn't get called. Any help on resolving this...

HowTo simulate Trackball/Cursor movement on android device?

I have purchased an Samsung Galaxy I9000 Phone, knowing that it does not have either a trackball nor a touchpad/cursorkeys. I thougt: simply write an application that reads gestures and sends/generates the appropriate cursor events. Checking the SDK documantation and found that this is possible after granting my application the permissio...

XML Parsing in Android [Java]

The API I need to work with does not support xpath, which is a bit of a headache! :-( lol The xml I want to parse is as a String. My questions: Is there a Java equivalent of "simplexml_load_string", where it makes the string into an xml document for parsing? Which is better for parsing, SAX or DOM? I need to get a couple of values o...

Failed to upload myapp.apk

All of a sudden I couldn't upload my apk on my device while debugging/running it from eclipse, this is the error: [2010-07-11 12:30:04 - myapp] Failed to upload myapp.apk on device '181D09BAD5D96180' [2010-07-11 12:30:04 - myapp] java.io.IOException: Unable to open sync connection! [2010-07-11 12:30:04 - myapp] Launch canceled! i trie...

Android error: The application has stopped unexpectedly please try again

I made an app which is just working fine. It displays the number of times app has been started. Here's the code: import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.widget.TextView; public class PreferencesDemo extends Activity { ...

Save a custom ListView's instance state?

I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides getView()). This custom adapter uses as its backend a List<CustomObject>. The elements in this List are retrieved from the network, so I would like to save it in onSaveInstanceState(). However, I can't find a way to put a List<E> in a Bundle. I'm thi...

Determine the content length of an Intent.STREAM_EXTRA (Android)

Suppose an app gets a content stream by being called with the android.intent.action.SEND filter. Also suppose the Uri and the stream is received like this: Uri contentUri = (Uri) extras.get(Intent.EXTRA_STREAM); InputStream in = getContentResolver().openInputStream(contentUri); Now, how can I determine the total length of the content ...

How to get an Alertdialog with the background out of focus (fuzzy).

I know how to make AlertDialog's of various types. But, how can I make an AlertDialog with the background fuzzy as if it is out of focus (i.e. like using a telephoto lens)? Whenever I search for 'focus' the result relaits to something like the onFocus commands, etc. which isn't what I mean. An example would be if you press the power bu...

What to do about PCM buffer in voice changer

Hi All, I am trying to write a voice changer for android and I'm running in to some design decisions which I need a little help with. I am using AudioRecord to get PCM audio from the mic, I need to record audio until the audio is below a certain level, I am then going to perform some processing on it and play it back. So I am unsure ho...

android, audio filters

I would like to make audio records (via MediaRecorder/AudioRecorder) and then play recorded file with some changes (special effects) (e.g. increasing/decreasing speed, adding echo, mix with other predefined audio file, etc)). Do you have any suggestions how can I do that? Do you have any interesting examples concerned this? ...

Save custom object array in instance state

I have a List<CustomObject> (where CustomObject comes from an external library -- I can't make changes to it). I want to save this in onSaveInstanceState(Bundle), but I can't seem to do it. Here are the options that I've tried: outState.putSerializable(KEY, (ArrayList<CustomObject>) myList); // because myList is instantiated as an Array...

How to create a pull out menu as a new Activity

How do you create a pull out menu as a new Activity. Is it possible to have a button that you can pull out as in the Google's built in camcorder app and have that start a new activity? Does a button support pull out? If not, what does? ...

How to design a screen in android?

I am new to Android. I wish to know how to design a screen by using java in Android. Design via xml and design via java which one is the best? ...

Android PreferenceActivity instance.

How can I find my PreferenceActivity instance, which was created by a framework? * * * My first class. /** This is MyAppSettings class, The instance of this class will be created by a framework **/ public class MyAppSettings extends PreferenceActivity { protected MySeekBarPreference mSeekBarPref; @Override protected void...

SAXParser problem grabbing tag value with & character

I have a SAXParser with with an XMLReader. SAXParserFactory saxPF = SAXParserFactory.newInstance(); SAXParser sp = saxPF .newSAXParser(); XMLReader xmlR = sp.getXMLReader(); MyHandler myHandler = new MyHandler(); xmlR .setContentHandler(myHandler ); My handler code uses startElement and endElement to detect with it's inside a tag. It ...

Error Installing with Admin Permissions

Hi all, I work for a cell company, our phones are based Android(SDK 1.5) we have the ability to sign our applications in our phones and give it firmware permissions, like: installing an extern application while using PackageManager.(SDK 1.5) this is what i did: File src = context.getFileStreamPath(fileName); Uri mPackageURI = Uri....

Does VPN in the Android emulator 2.2 work?

Hi, has anyone gotten the VPN in the Android 2.2 emulator to work. My config worked on a real phone but not on the emulator. Is it my networking config on emulator+MacOS that is stuffed up, or is it just not working thru the emulator's 10.0.2 proxy? Song ...

Android ViewFlipper animation does not render background!?

Hi, I'm using a ViewFlipper with two ListViews. When setting a background drawable on the ViewFlipper, the animation performed when "flipping" only renders the foreground, and background is black! When animation is done, the background appears. Is there a known problem with animating the background "layer" of a view? Also, the animation...