android

How big can I make an Android application's canvas in terms of pixels?

I've determined an estimate of the size of my Android emulator's screen in pixels, although I think its resolution can be changed to other numbers. Quite frankly though that doesn't eliminate the general problem of not knowing how many pixels on each axis I have to work with on my Android applications in general. The main problem I'm t...

Intents? How to register to be alerted for incoming emails?

Extreme Android developer newbie here...well, new to Android development, not development in general. I want to write an application that gets notified when emails come into the device, and takes various actions based on data in the email (subject, sender, to, etc). I think what I have to do is create a BroadcastReceiver with an Intent...

Getting the battery current values for the Android Phone

I am trying to collect power usage statistics for the Android G1 Phone. I am interested in knowing the values of Voltage and Current, and then able to collect statistics as reported in this PDF. I am able to get the value of Battery voltage through registering for an intent receiver to receive the Broadcast for ACTION_BATTERY_CHANGED....

Why dont Android applications provide an "Exit" option?

Is there something in the Android developer guidelines that disuades developers from providing the option to "exit" (stop running) an application from within the application itself? I love multitasking and all but it's not clear to me why: the vast majority of apps don't have their own Exit functions and hence just keep running fore...

Thread help with Android game

I need some help dealing with three Threads in Android One thread is the main thread, the other is the GLThread, and the other is a WorkerThread I created to update the game state. The problem I have is they all need to access the same LinkedList of game objects. Both the GLThread and my WorkerThread only read from the LinkedList, so ...

Android - Fill Layout with Buttons

Just a quick question about how you would go about implementing this. I want there to be buttons at the bottom of the screen, but if the screen size is larger, more buttons would be added. For example, at a small screen size, there might be 4-5 buttons at the bottom, but if you ran it on a tablet or something similar, there would be ma...

How to stop an Android Service ONLY when there are no other activities in my app running?

Is there a way I can test if there are any other activities in my app still alive? I am looking to stop a service in an onDestroy method, but only want to do this if there are no other activities from my app still alive on the stack. I have the call stop the service in the main activity's onDestroy() method. This works perfect EXCEPT t...

Android Gallery View Update Images

Hi, i have a question about using GalleryView. At first, i set five "default images" to show from drawable directory. But after, i want to run an Async Task in which i download the images, save them and show them in the gallery. For that i created the following Adapter: public class ImageAdapter extends BaseAdapter { int ...

Unable to stretch TableLayout to screen width

I've tried unsuccessfully for quite a few hours now to simply get a TableLayout to scale to the full screen. I've tried stretchColumns, shrinkColumns, (specifying the column index or using *) you name it. It's almost as if the parent element (TableLayout) is completely ignoring 'android:layout_width="fill_parent"'. I've read through s...

When do I synchronize methods or use synchronized blocks in my methods in an Android game?

I'm looking into writing simple graphics code in Android and I've noticed some synchronized() blocks. What is the reasoning behind this and how do I know when I should be "synchronizing" my code? ...

onPause/onResume activity issues

I have a small test application I am working on which has a timer that updates a textview to countdown from 100 to 0. That works fine, but now I am trying to pause the application if the user presses the back button on the phone and then restart the timer from where they left off when they reopen the app. Here is the code I am using: ...

How to make an adroid app return to the last open activity when relaunched?

Is it possible to configure an android app so that if a user has opened your app, launched numerous activities, then returns to the home screen and relaunches your app again, instead of going to the main activity they will instead be taken to the activity highest on the stack (the most recent activity in your app)? ...

ListView, CheckBoxes and the ID's

So, i'm having a problem (newbie one) with a CheckBox Listener AND a ListView. I need to request the '...long id) that passes through the Overriden method onListItemClick and put it into a OnCheckedChangeListener. How should i do that? If you guys need the code i can post it! Thanks in advance!! ...

Which mobile operating system should I code for?

I would like to rewrite two of our programs for mobile devices, but am a bit lost as to which platform to target. Complicating this decision: I would need to learn the relevant languages and IDEs - my coding to date has been almost all web based (PHP, JS, Actionscript, etc. Some ASPX). Most users seem to be religious about their mobil...

Can content provider notify observer without calling NotifyChange() explicity - Android

In ContentProvider we explicity notify all registered observers to it by calling getContext().getResolver().notifyChange(URI,ContentObserver); I want to know if this is necessary. Is there any possibility that observers get notified, even we don't use that statement at all in our contentProvider. Is there any other way to do ...

Android TranslateAnimation after scrollTo() = undrawn view

This might be a "duh" question but I'm going to go ahead and ask it anyway. I have an oversized (bigger than the screen) RelativeLayout, and I'm using swipes to start a TranslateAnimation from viewing one part of the layout to another. Say for instance the layout is two screen wide and two screens tall. After the nice animation to shift...

set system setting "use only 2g networks" programatically

how can i force the system to use 2g instead of 3g? there is an option for this in the system settings but i didn't find a function in the android-sdk to set this option! thx ...

Android Color Picker

Does anyone know of a quick color picker widget that I could grab to use in my application? I've seen one in a few different applications that has a wheel with colors, and that you tap in the center to select, but I'm not sure where to find it. Google brings up nothing. Any color picker would be fine though. Thanks. ...

View the Task's activity stack

Hi There, I just started developing a simple Android application while I'm still learning its platform. I'm using Eclipse IDE with the ADT plugin 0.9.6 and I need to know if it's possible to view the activity stack that is associated with a Task. Is there any way through the DDMS tool or through any other technique? Thanks in advance ...

When is better to complete a save of Seekbar onProgressChanged vs. onStopTrackingTouch?

I have a Seekbar and I want to save the state to database when the progress is changed. I am wondering in which event to put my code onProgressChanged vs. onStopTrackingTouch? ...