android

Letting a third party app start my activity directly?

Hi, I'm working on an activity which other 3rd parties want to use in their own apps, via intents. Right now this activity is catching urls via an intent filter, like this: <activity android:name=".MyActivity"> <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent...

Google Navigation (Android 1.6) intent callback

I'm using intents to launch Google Navigation: Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location)); startActivity(i); location is a string with GPS coordinates. Google Navigation pops up nicely and plots the route. Can they return some type of callback when the user has reached their destination? ...

Problem playing audio on android

Amendment: This appears to be a problem with the particular audio file I was using. Other applications on the droid such as the Astro file manager also fail to play it, and if I replace it in the package with an AAC file, it plays it without error. I encoded the problematic audio file to MP3 format from a WAV file, using LAME on ubuntu...

Laying out Views in RelativeLayout programmatically

I'm trying to achive the following programmatically (rather than declaratively via XML): <RelativeLayout...> <TextView ... android:id="@+id/label1" /> <TextView ... android:id="@+id/label2" android:layout_below: "@id/label1" /> </RelativeLayout> In other words, how do I make the second TextView appear below the...

Can my android application be launched from built-in Phone Call Log application?

Hi, I would like to know if it is possible to launch my application whenever a new entry is written to phone call log (i.e. out-going, in-coming or missed call). I wrote an application to manage the call log entries as per user preferences by listening to the publication of android.intent.action.PHONE_STATE events. My application is wo...

Array index lookup versus Instance field lookup

Is someArray[index] a faster way to get to a value than someObject.field? E.G.: if(intArray[i] == 42) {//do stuff} VS if(someObject.x == 42) {//do stuff} I will try to test it soon and post the results; just wondering if you all had any thoughts. ...

Unexplained error from MediaPlayer

My code tries to play an MP3 file from res/raw. Code: FileDescriptor fd = appContext.getResources().openRawResourceFd(R.raw.ringtone) .getFileDescriptor(); player = new MediaPlayer(); try { player.setAudioStreamType(AudioManager.STREAM_RING); player.setDataSour...

Fillrate Issues on Android Emulator

I'm getting very low framerate with OpenGL ES. If the model is far from the camera I get like 35 fps, but if it fills entire screen (say, a skybox) I'm getting 6-8 fps. It even happens when rendering a skybox alone and nothing else. Is that actually an issue with the emulator? I'm using Windows XP SP3 on a AMD Athlon 64 Dual Core 3800 ...

Adb won't start

Running Vista, tried starting adb from shell as admin get daemon not running starting it now ADB server didn't ACk failed to start daemon. Any help for this? ...

How to make an alert dialog fill 90% of srceen size?

Hi, I can create and display a custom alert dialog just fine but even so I have android:layout_width/height="fill_parent" in the dialog xml it is only as big as the contents. What I want is dialog that fills the entire screen except maybe a padding of 20 pixel. Then the image that is part of the dialog would automatically stretch to t...

Accessing AlertDialog in AndroidTestCase

I'm using ActivityInstrumentationTestCase2 to do automated black-box testing on my GUI. Is there a way to click on a dialog, or get Views belonging to the Dialog in unit tests? The only way I could come up with is to keep a reference to the dialog and have my Activity implement a getter method to let testcases access the dialog. Is ther...

Is there any Android game framework ready to use

Do you know any tile based game framework for android like HGE for PC or at least some good examples of tile based engine for Android ...

How do you retrieve the array adapter currently set for a spinner? Android OS, Droid

Looking to create a menu toggle that switches between two possible arrays for a spinner. For example, if the spinner is set to show array A, then when I press this menu button, I want the spinner to be set to array B. If I press it again, I want it to be set back to array A. I can handle the if/then statements and all, but how do I call...

Android Custom Listview

Hi ive got a custom listview and im trying to start a new activity on a button click however an occur occurs when i try to set an intent , i guess this is because my custom array class does not extend activity. The buttons trigger an alarm to be set. Is there any way i can get an intent to work in this class? Below is my code for the cl...

Problem with AlertDialog

Hi everyone. I'm having problem with creating AlertDialog. I would like that AlertDialog appears when i click on one button, so i put all code for creating dialog in that button listener...the same code works outside that listener but inside listener doesn't work...it doesn't call any errors but when i start emulator written is somethi...

Need suggestion about a mixed "Uri / int id" images ambient.

Hi everyone, I have the following problem: suppose that until now, I am using R.drawable.img to set the image in some imageviews with imgView.setImage(aProduct.getImgId()); the simplified product class look like this: class Product{ int imgId; .... public void setImgId(int id){ this.imgId=id; ...

Problem running android HelloTabWidget example - NullPointerException on addTab()

I've tried the Tab Layout example, and I've also fixed the few typos in the example (and added all the activities to the manifest). However, when I run it on the emulator I get a NullPointerException on the first line that says tabHost.addTab(spec); So my question, of course, is. What is wrong with the example that would cause th...

ClassNotFoundException when using custom Parcelable

Hi Folks I use a custom Parcelable to carry some data to a BroadcastReceiver. Here is what i do: I register my intent and set the extra Parcelable on it along with an extra classloader (intent.setExtraClassLoader(..)). Next i schedule the execution of the broadcast via an AlarmManager. So when the AlarmManager fires it looks at my int...

Creating a drawable rectangle in xml with one gradient on the top half and another on the bottom half

I'm trying to create a drawable in xml, a rectangle with one gradient on the top half, and another on the bottom half. This is NOT the way to do it, apparently: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item> <shape android:shape="rectangle"> ...

Align Layout to the right in a ListView row?

I'm trying to get listview row to look like the following: | Text-Text-Text <ImageButton> | With the imagebutton snapped to the right edge. How can I do this? Here's the current layout code I'm using. What am I doing wrong? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.and...