android

When I scroll a listview with a custom adapter too fast up and down, getView() starts behaving oddly. Why?

I have a listview with a custom arrayadapter that handles about 15 strings. The style of each row alternates (between labels and values for those labels--for example row 1 could be "email address" and row 2 would be the actual email address). I'm changing the style of each row to alternate like this in the arrayadapter's getView() method...

I can install an application but I don't see its icon in the set of installed applications(on the emulator).

Hey, When I load an application(which I just compiled) in the emulator. I don't see its icon in the icons of the installed application(on the emulator). The command "adb install ..." tells me that the application is successfully installed(I can even uninstall it with "adb uninstall ..." command). The application is nothing more than a "H...

Value passed from Javascript to Java through JavaScriptInterface not working

Why below code is throwing nullPointer exception in last line (when accessing javaInterface.mValue) This line through NullPointer, so basically it is not being set. even though the javascript is correct and has been verified using FireBug that it returns expected string. There are few lines above this code chunk but it is irrelevan...

Changing Activities within Tab

Alright, so I have an application that has a tabbed interface. What I would like to know is how I can change the currently active Activity in the tab, and then when I'm done with that Activity, go back the the original Activity, exactly as it was. Would I be able to use something like a ViewFlipper for this? Or probably not? ...

How to to store http-cookies between sessions

I'm developing an app that logs into a web site. To do this I use the HttpClient object. I noticed I could get all the cookies from the post requests with the HttClient.getCookieStore method, the question is however how I save these cookies so the next time the app is started, the user don't have to log in. I should also mention that w...

Finish parent and current activity in Android

I have 3 activities. Activity A which leads to activity B, which in turn can go back to activity A or start activity C. However, if I press back in activity C the app should close. To sum up: Activity A starts activity B Pressing Back on activity B should lead to A Activity B starts activity C Pressing Back on activity C should close ...

android wake-up action

Does anyone know if it is possible to force an app to start automatically when external power is applied - i.e. the following scenario: - app is running (with permanent external power supply; this would not be a 'mobile' app); - external supply fails for some reason; - battery runs low so device turns off; - external supply resumes; - ap...

Problem with some advanced UI

Hi, I'm trying to create tables with rounded corners. I've quite a bit of XML to do this, but I have a problem. The table is wrapping itself to the width of its inner text. I want the entire thing to fill the parent (though I want a border around it so there is some cushion, which I have). I can't understand why it is not when I have...

How to detect an android device whether it supports google maps API

Hi, Hi all, I am currently developing an android application uses Google map API. I am wondering does all android devices support map API, becuase this api is an optianal api and it is an add-on to the platform. I am worried that my application won't be able to run on that device. What I need to know is programatically detect wether...

Android - VideoView video scaling - different screen orientations and devices

How does Android handle scaling of a video being played within a VideoView? So for example if I have a video that is say 480 X 270 (width and height), aspect ratio 16:9. And, say the VideoView is added to a LinearLayout with LayoutParams of (480, 270). What will be width and height of the rendered video in portrait orientation in a devi...

3GP/AMR mix/merge tracks

Is there an easy way to merge 2 3gp (amr) audio files into 1 single audio file? I need them to be synchronous/over top of each other not one after the other. I am using android to do this. I have heard somewhere that for some audio formats you can simply add the bytes (being careful that you dont get a too high or too low result). Is...

Android: How to give focus to a background Activity belonging to a different task?

Say that the user has started my App and then switched off to use the Browser (so we have 2 sets of Tasks running). After a while, something happens to my app that requires the user's attention, so it posts a notification to notify the user. Is there a way to bring my App's task (and the Activity on top of the stack) out from the backgro...

Android Contact Search w/ multiple parameters

I am trying to do a Contacts search on Android using ContactsContract. I would like to search on multiple parameters, e.g. - Where name = myname AND email = myemail AND nickname = mynickname, etc. I have it working w/ just name, but need the syntax to add email and nickname as search params. I know they are stored separately from disp...

Augmented Reality via (common) Web Cam / iPhone / Android - Grid Detection? - Harry Potter 3D Example

I'm trying to figure out how to implement a basic augmented reality application that uses a piece of (real) paper to navigate (simple rotate, zoom) a virtual 3d or pseudo-3d space. The example implementation that comes to mind is the Harry Potter 3D Augmented Reality ad, where you can take a piece of paper, point it at your webcam (at ...

On Android: How can I rescan an entire folder to watch for changes in .nomedia

So my app downloads images at the users' request from an online source. Through a button in the activity, the user can choose to hide or show the images in the gallery. This is easy enough, I just add or remove a .nomedia file as needed. However, I want to rescan media every time so that the change is instant, and requires no further ...

How to use setMultiChoiceItems() with a Custom AlertDialog that uses an efficiency arrayadapter?

I am writing a music player that uses a custom Adapter extending BaseAdapter (efficiency adapter) that I want to display in an AlertDialog using setAdapter() where the user can either click on one of the songs to switch to that position in the playlist OR check songs to remove from the playlist. I tried using a custom click listener so t...

Set ListView Adapter with composite PRIMARY KEY in SQLite table

I've bound data from a SQLite database table to a ListView using a SimpleCursorAdapter. This works well when I use _id INTEGER PRIMARY KEY AUTOINCREMENT as my table's primary key. However, I'm trying to use a composite primary key such as the following: CREATE TABLE table ( column1, column2, column3, PRIMARY KEY (column1, column2)); F...

Adding direct dial shortcuts to my app.

I'm making an app that can launch other apps. I've got it launching apps fine using Spinners, however, I would also like to give the user the ability to launch direct dials from it. As it is right now I've got "hot key" buttons that the user can configure. Currently, when the user wants to configure one of these "hot keys" I use a spi...

Andriod Home Screen effect

I want to do something like andriod home screen effect. when i click the screen and move. the current view will move and next view also can show. Now the code only can show the current view. Thank you for your help The source as follow: public class test extends Activity implements OnTouchListener{ float downXValue; /** Called whe...

Android MediaPlayer - How to get Correct Duration from Streamed File

When I stream music using the MediaPlayer, it gives me the wrong song duration. Has anyone else encountered this? Work around tips appreciated. ...