android

Android : whenever the phone is connected to wifi send an http request

hi everybody, im trying to make an android application that whenever a user conncects to a wifi, application sends an http request to my server, later on by using push notification server sends some msgs to the user. but in here i have a problems: how to make this application running in background and also it understand if phone is con...

Variable OnClick Listener Android

Is there a way to have 1 onClick Lister for many buttons where I can toss a case statement to do things based on what buttons were clicked. I know I can make 100 different listeners for 100 buttons but I have to think I can create some nifty variables to do it in less lines of code. ...

Specs and Functionalities of Nook E reader(Developer Thoughts)?

What are the things that an android developer does to achieve it. So I need to know the basic functionality difference of IPad and other E-readers. I heard about Nook which runs an Android operating system. How do I test my app on that nook, i.e. is there any emulator configuration to test the application of nook? (Because I don't have ...

RelativeLayout margins

Let's say my current simulator has 480px width. I add a button to the screen in position 460dp What will happen if the user's device has 400px width? Does the button go out of the screen? ...

Best way to update an Android widget every 20-30 secs: Handler, Service or Alarm?

I have a 4x4 widget and i want to update a little piece of it every 15-20 seconds. Clearly i don't want it to be updated when the phone is in standby. The widget needs also to respond to some system events other than my timer. So, which is the best option? An AlarmManager: nice but probably cpu intensive if it needs to be run every 20 ...

How do I change the color in List simple_list_item_multiple_choice

Hi I have a list with simple_list_item_multiple_choice layout. The list is all in white and my background is also white and hence it is not visible. How do I change the color for that?? Thanks, Prerna ...

build this layout in xml?!

I have a listActivity and wanted to create a list with the second layout (attached). What has any idea how to build this layout in xml?! show imageAttached ...

Using onListItemClick with data driven ListView

I have a ListView which its contents could change at any time (eg. a list of cities within a state; a new city could be added to the state in our database at anytime). How do I implement, if possible, the onListItemClick event to work with this? For example, if a user selects a certain city in the ListView, i should be able to pass a val...

BaseAdapter causing ListView to go out of order when scrolled

I'm having problems with some BaseAdapter code that I adapted from a book. I've been using variations of this code all over the place in my application, but only just realized when scrolling a long list the items in the ListView become jumbled and not all of the elements are displayed. It's very hard to describe the exact behavior, but ...

Android popup window dismissal

Hello, I have a popup window displaying when I click an item in my list activity. The problem is that the back key doesn't close it. I tried catching the back key in my list activity but it doesn't register it...then I tried registering a onkeylistener to the view I'm passing to my popup window. Like this: pop.setOnKeyListener(new View...

Playing a Flash File in Android SDK

I head Android 2.2 supports Flash, but I'm not sure what that means for the SDK user. I'm using Android 2.2 platform (emulator and eclipse). In the emulator, I launched 'browser' app, and browser to the URL which has flash swf embedded, but I couldn't see it. Am I missing something?? Thanks! fsustim ...

Button In FrameLayout ==> Change y? Android

I have a button in my FrameLayout. When the user selects the button i need to bring the button a little bit higher, so decrease it's y. How can i do this in code? ...

ProgressDialog in AsyncTask throws an exception

I'm trying to make a simple ProgressDialog appear while my AsyncTask is fetching data. In my onPreExecute() method I have this: pd = ProgressDialog.show(c, "Loading...", "Please wait"); c is the context passed into the constructor of my AsyncTask from this.getApplicationContext(). Unfortunately, I keep getting an exception with this m...

Is it possible to bypass constructors when instantiating objects in Android

Do Android have any way to instantiate objects without calling any of its constructors? In Java, Sun have sun.reflect.ReflectionFactory.getReflectionFactory().newConstructorForSerialization(), in .Net we have System.Runtime.Serialization.FormatterServices.GetUninitializedObject() but I was not able to find anything like that in the And...

When is advised PendingIntent vs. LocationListener on requestLocationUpdates?

you can subscribe to requestLocationUpdates via two ways one by specifing a PendingIntent the other is by using a LocationListener When is advised the one and when the other? ...

How to prevent starting the activity at the first tab in a TabActivity?

I have a TabActivity, which contains 4 activities. My code sets the second tab as the current tab: public class MyTabActivity extends TabActivity { TabHost tabHost = getTabHost(); TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab TextView tabView; // Create an In...

Do I need to add an intent-filter when starting a service?

I am following a tutorial to setup a service to start on boot where the last piece of the code is: Make an entry of this service in AndroidManifest.xml as <service android:name="MyService"> <intent-filter> <action android:name="com.wissen.startatboot.MyService" /> </intent-filter> </service> Now start this service in the BroadcastRec...

TextView on android only shows two lines worth of text in either orientation

if the text is longer than the the width the textview, after the second line, it cuts it and adds "..." to the end of it. It doesnt matter the orientation, it will just display more text until the end of the second line, here is the textview XML: <TextView android:id="@+id/ContentViewerDescription" android:layout_width="...

Android, activity for each view mode? Or switch statements inside fewer Activity classes?

I know how to functionally do each of the following scenarios, my main question is which is the better design decision? Based on app size/speed and battery life and such. So I will have several activities that will display different lists. They're all lists of the same object, but the objects' states will be different in each of the lis...

Android marketplace - public key

Hi, I'm just about to submit an application to the Android Marketplace. There is this message when I try to upload the app: Remember to change the public key in updates for this application to match your new public key on the Edit Profile page Where can I find the public key? I went to http://market.android.com/publish/Home and click ...