android

Using a ListView to create a settings screen in android?

I'm developing my first android application, and i'd like to create a settings screen. I'd like the screen to have a similar look-and-feel as the native phone-settings screens and the native "create/edit alarm" screen. Thus with different kinds of (statically defined) items vertically stacked with a thin line between them. How do I de...

Dialogs / AlertDialogs: How to "block execution" while dialog is up (.NET-style)

Hey! Coming from the .NET-environment Im am now looking to understand how Dialogs work in Android. In .NET, when calling MessageBox.Show(...) that creates and shows a popup dialog. In the call to Show I can specify what buttons should be available in the popup, for example: DialogResult myDialogResult = MessageBox.Show("My text here"...

How does a BackupAgent work?

I'm looking at AndroidManifest files and I see entries for android:backupAgent and according to the Documentation android:backupAgent is The name of the class implementing BackupAgent to manage backup and restore of the application's settings to external storage. But I can't find a BackupAgent interface or any other documentation. ...

VerifyError in App After Upgrade

I've got a small issue which I was hoping someone could give me some insight on. Sometimes, when a user updates my app from the market (from one version to another) they get a VerifyError upon running the app. It happens to a random class; you can use part of the app, then going to a different Activity in the app causes it to blow up. ...

How to scroll programatically a ScrollView ?

Hi, I have a little problem with a ScrollView. I have a layout for an activity which is made with a ScrollView. This scrollview contains two ListViews. <?xml version="1.0" encoding="utf-8"?> <ListView android:id="@+id/accountsListView" android:layout_width="fill_parent" android:layout_height="wrap_content"...

How to create a wrapping horizontal list

I'm attempting to create a list view in Android that shows clickable items that wrap horizontally much like the "To" field in the OS X and iPhone's Mail programs. They have a horizontal list of names that wrap vertically and each name is a separate object, the list is not just a single string. My questions are: Is there a way to do thi...

How do you do your dynamic layouts?

I want to dynamically hide/show controls in an activity based on a button touch event. When the user presses the "details" button I want to show more controls in the same activity. What is the best way to handle this? Is there a way to do TextView.Hide()? Can it animate the transition. Thanks ...

How can I create my custom properties on xml for Android?

Hi. We have in our project a keyboard with "Key" elements, this Key elements have attributes such as android:codes="119", android:keyLabel="w" and so on. My question is how can I include an custom attribute like a "android:alternativeKeyLabel" to do something else. ...

Adding overlay image at drag position on a final bitmap - Android

Basic description of what I'm trying to do: Load up a background image, paint some text into a new bitmap layer, position that text over the background image where I want it to show up, then save the background image with the new layer on top of it where I had positioned it. Problem: The problem I'm having is that when I paint the text ...

How to listen for Exceptions in Android?

Some of the analytics packages (for instance, Flurry) will listen for Exceptions and log them w/o actually catching them. How are they doing this? ...

Play playlist with MediaPlayer

Hi, I'm trying to play a playlist I get using the MediaStore provider. However, when I try playing a playlist nothing happens. Can a MediaPlayer play a playlist (m3u file) and do I need to set the first track to play ? This is my test code in the onCreate() method: Uri uri = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI; ...

Google Developer Phone

Hi, Do I need google developer Phone to be an android developer? If I purchase a phone from Rogers with Android OS, is that ok for me to write applications and try it out? Let me know what is the best practice? Thanks Naeem ...

Why won't @override work??

What is wrong with piece of code? @Override protected void onCreate(Bundle savedInstanceState) { Eclipse states that @override cant be where it is. It says that 'Bundle' is wrong. I am lost. ...

Get device settings to see if "Mobile Network" is On or off?

Hey, Ive been trying to find some way in JAVA-code to determine if the device has "Mobile network" enabled in Settings. I have been looking around, but havent found the answer yet and since I know that StackOverflow is a great place, here I am =) So, any tips on how to get it? ...

Content Provider is part of my application?

Hello, I need to create 3 things: Content Provider Service Application I'm wondering if these all three will be in one single project, or they will be three different projects? Also how can I limit my Content Provider to my services and my applications? Regards, Pentium10 ...

Why is the app waiting for the debugger when its not connected to computer?

It seems like every step I take in the Android world I run into problems. Im soon up to 20 questions here on StackOverflow hehe =) Usually, I have my HTC Hero connected to the computer via USB and I launch the application either in debug mode or in normal mode. So, the last time I ran the app in normal mode. Then I disconnect the devic...

Disappearing imagebutton in my layout - why?

The last image button is not being rendered (in fact I see an error which quickly disappears to show the rest of my view minus the last imagebutton. My activity layout looks like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Scro...

MediaScannerConnection Android

Hello Everybody, I would like to know if it is possible to scan with MediaScannerConnection an audio file that is not located on the sd card of the device. I mean, Can I pass the file to the MediaScannerConnection using streaming?. Thanks. ...

Passing a variable's value not reference in an OnClickListener()

Hi, I'm trying to set up a large number OnClickListeners through a for loop. Each view should run a method when clicked; view 0 should run the method with the value 0, view 1 with the value 1, etc. However, if I declare the OnClickListener using a variable which increments through the for loops, the OnClickListener remembers the referen...

Why does this error occur when I try to run a Junit test-case on the Android emulator?

After following some instructions on Diego Torres blog I am able to test my classes using the regular Eclipse JUnit test-runner, however I also want to be able to run my unit tests from within the emulated android environment. For now this should make no real difference since the classes I am working on do very basic numerical or netwo...