android

pop-up type view (z-index?) - android

I want to add a new view to my scene that will contain content that will change programatically throughout the course of my application. When it does change, it needs to pop up on the screen for 3 seconds (or a click) then disappear. This view will change in size according to its content WRAP_CONTENT, but ideally I'd like it centered h...

android assign a drawable dynamicaly to a imageview

I have an array of drawables, that I would like to change by my own timer to a imageview. (i tried the other option with xml and setBackgroundResource, but does not work for me as I have hundret of pics and always got memory problem as it looks android assign already the whole memory for all pics at once. (just in this demo i shorted it...

cancel dialog after 3 seconds - keeps crashing my app after multiple uses

I have an extended dialog class that I want to show for 3 seconds then disappear. This works great the first 2 times it's called, but then it crashes my app after that. Admittedly, I'm not the best with threads and I think that's where my problem might be. As you can see from the code below (commented out section), I tried using a can...

Custom Title Bar with Progress in Android

Hello all, I was wondering if there was any way to feature a custom title with my own drawable -- and then subsequently put a progress bar in the title layout so that it acts like the built in android progress bar. In my code -- I want to be able to call setProgressBarIndeterminateVisibility(true) and have that display the progress b...

Android Market Licensing: Check during onCreate() or onResume()?

In the included LVL sample app, the license check is triggered during onCreate. This means that when I click "Buy App" to launch the market, then immediately hit the back button to return to the app, the dialog is gone and another check isn't performed, leaving me with a perfectly usable app (at least until the activity is killed and th...

Android Development: Button onClickListeners Help

Basically, so far I've just got an add and minus button which will change the value of a TextView. I followed the second example under "Event Listeners" on http://developer.android.com/guide/topics/ui/ui-events.html The problem is I get 4 errors when I go to compile, I don't see what I'm doing wrong? Please can someone point out if th...

Accessing contents of R.string using a variable to represent the resource name

Hello, I have a few strings which I need to translate and display. Those strings are in variables. I have the translation in the strings.xml file. I want to display the "translated version" of the string. For example, inside an Activity: String name = "Water"; TextView nameDisplay = new TextView(this). nameDisplay.setText(name); In ...

16 bit images and android processing.

Am i correct in saying a 16 bit image will be decode and drawn faster than a 24 or 32 bit? I know the file size will be less but if the bitmaps will actually be drawn faster than it would be worth the effort to convert them. If it is faster, how would i go about saving a 16 bit jpeg file? I only found an option in photoshop to save a 16 ...

What is the difference between a background and foreground service?

I am currently writing my first Android application and I keep running into references to background and foreground services. Since I intend on using a service in my application I was hoping to get a clarification between the two and how they are used. ...

Is there a generic way to activate led flash light on android 1.6.

I am trying to implement a code that uses the camera LED (Flash). It is similar to the torch applications that are available on the market. I guess in android 2.1 and above this can be achieved by using FLASH_MODE_TORCH. Is there a generic way to do the same on android 1.6. ...

How do I run a method every 10 minutes in Android?

I am looking to run a certain method call every ten minutes in Android, what is the best way to go about implementing this? I am currently looking at using the Handler object's PostDelayed method. ...

How to test to see if GPS is working in Android App?

I would like to be able to test to see if the Phone's GPS is working or not (in the app's code). Right now, I am just trying to directly access the GPS location without an if ( GPS_is_working ) { } I am having a problem right now since when I access the GPS when it is not working, the force-close dialogue shows up and my activity i...

Screen Size In Pixels

Hi, What is the max x, y size of a Android screen in pixels? Is there a standard set by the OS or does it mostly just depend upon the phone hardware. Thanks ...

Create Smaller Tabs in Android

Hello, I am trying to create smaller tabs in android -- but I can't seem to get it to work because all that happens when I create a smaller tab is that it shows the bigger tab -- but without a drawable. This is my layout code for tabs now -- but the height isn't wrapping for some reason -- it just goes to Android's usual layout height...

Failed to set a Button below a MapView

Part of my Layout is shown below, but the Button shows up above the MapView and NOT as expected "below" the map. How can I fix this? <RelativeLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.android.maps.MapView android:id="@+id/ma...

android ListView replacement for ScrollView

I have a complex layout file with many TextView's and EditText's placed on the canvas. The layout needs to be a ScrollView in order to properly work for the user. The problem is that 2 fields should really be ListView's with all the formatting that comes with them. Neither of these lists will be more then 10 lines long. I am currentl...

Problem launching app

When I load my Android app to run on my Droid X, it says "application not loaded" and gives the following error message in the console. Must be something with the permissions or the Launcher as far as I can tell. Thanks, Bill [2010-08-20 23:15:39 - Memory] Installing Memory.apk... [2010-08-20 23:15:40 - Memory] Success! [2010-08-20 2...

Why does my MP3 play in Android's Music app but not using MediaController?

Hi, I have an MP3 audio file that I want to play from my Android app. I am using MediaController and VideoView like the answer to question 2961749. I get the error "Sorry this video cannot be played." But if I copy the file to /Music on my sd card, I can play it with the Music player app on Android. I've also tried just using MediaPlay...

Problem with Droid X

I've only written a handful of apps, but all the bad feedback I get is with Droid X phones. Is there something fundamental I'm missing with this phone? I test with a HTC Desire but always take into account the 480 x 854 screen layout. It's becoming a bit worrying. Any help appreciated. ...

How do I get data from a running service

I have just started using services in Android and I have a made a simple service that is polling a server every 20 seconds. Now how can I get this data from my main activity (when it is active)? Alternatively the service could send it back do my main activity (but only if its active). I don't want to wake up my activity. I have read ...