android

How to attach a text file stored locally in app directory

I have an Android app that saves a text file directly onto the phone, in the app's install directory. I need to allow the user to create a new email, attaching this saved text file. When I start the intent to send the email, everything shows up in Gmail correctly, but the attachment does not get sent. All of my searches on stack overflow...

Eclipse DDMS not recognizing my Backflip

When I plug my Android Backflip into my computer, WIndows 7 recognizes it but it never shows up in Eclipse's DDMS. I have the USB Debugging checked under Development on the phone and I can see virtual devices I create just fine in DDMS but never anything at all for Backflip. Does anyone know of something else that needs to be done? I se...

Run Method when Preference is Updated

How would I add a listener so that when a preference is changed (i.e. CheckBoxPreference) some method is executed (i.e. Toast) Preferences.java public class Preferences extends PreferenceActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml....

Open sms inbox activity

I'd like to launch the activity which displays the sms inbox from a broadcast receiver. However, I haven't seen a way to do it using the SDK. I think it needs to be something like this but it doesn't work for me. Intent defineIntent = new Intent(Intent.ACTION_MAIN); defineIntent.addCategory(Intent.CATEGORY_LAUNCHER); defineInten...

streaming image from url, android

I need to load, and update image from URL. Using AsyncTask, Iam able to load image from URL bt i need to reload image from url for every 10 secs. Please help me how i can solve this issue. Thanks in advance ...

Want to load part of an array into android ListAdapter

My code works like this to list all items in my String array - itemsarray setListAdapter(new ArrayAdapter<String>(this, R.layout.row, R.id.label, itemsarray)); However, I know by this call that I only want to list the first X number of items from itemsarray. How can I load only the first X items form itemsarray into the ListA...

More elegant way to decode \u0000 Unicode in an input stream

I'm parsing an input stream coming from Facebook. I'm using something like BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8")); And then in.readLine to actually read from the stream. The stream seems to have Unicode characters already encoded in ASCII, so I see things like \u00e4 (with \u actu...

List Preference and Shared Preferences

When and How do you use the ListPreferences? Is it an alternate for ListActivity, listView? How do you decide whether this is the better choice? ...

Android: number of MenuItems in a row

Hi, anybody found an easy way to change the number of elements in a menu row? I have 5 MenuItems. They are put in row 1 with two, and row 2 with three items. Is there an easy way to make row 1 to have three items and row 2 to have two items? Thanks! Llappall ...

Creating Android Contacts Application

I need to create a contacts application that mimics the native android contacts application. The applications needs to be ported on all the android devices and should support the fields that a native application contains. I need to know what all fields does the Content provider supports and how does it deal with the devices in which the...

Handling Device Rotation

I want to disable the view change on device rotation for the time being. Its giving foreclose error when i rotate the device and starts all over again. I have used tab activity everywhere. How should i proceed ? ...

Unbearably slow android emulator -- is there a fix?

I know that the topic was discussed here last year, but I am hoping that someone has since found a fix. The emulator is simply not working for me anymore. It took 15 minutes or so to load hello world a few days ago, and now i cant get it to load a simple MapsDemo from the api samples no matter how long I wait. Im using eclipse with ...

Interface Builder(User Interface Designer) for Android

I am working on Android since last 7 months....Also knowing brief about I-phone application. In Android, There is a bad layout editor in Eclipse, but it's neither good nor User Friendly as I-phone Interface Builder is. Is there any visual designer that would be on par with the iPhone "Interface Builder" ? Ya, DroidDraw is there but n...

In Android, how can I set a ListView item's height and width?

I want to create an interface that has one or two listviews that ultimately span the entire screen with two rows. How can I change their height so that they take up 50% of the screen, vertically? If it's along the same lines, I'd love to know how to do this regardless of orientation. With regards to width; let us say I have two listvi...

facebook android

Hi i'm begginner in android, devolping apllication in android to connect facebook and upload photo by using android facebook sdk but when i login i'm getting allow perimsion window when i click allow its not giving any action what is the problem please help me. Thanks, San ...

Why MediaRecorder.start() hangs if audio source is VOICE_CALL ?

Why MediaRecorder.start() hangs if audio source is VOICE_CALL ? It works fine if audio source is MIC. And another question, is there way to debug native platform methods, MediaRecorder.start() par example ? Thanks for advices. ...

Android: Add two text views programmatically

Hi, I am trying to add Views to a linear layout programmatically. LinearLayout layout = (LinearLayout) findViewById(R.id.info); String [] informations = topOffer.getInformations(); TextView informationView; View line = new View(this); line.setLayoutParams(new LayoutParams(1, LayoutParams.FILL_PARENT)); lin...

Populate ListView in Runtime in android

I am having a problem in UI. I have Two edit text fields on UI and 1 Add Button. And functionality of a button is to take values from edit text fields and add them to list. The issue which I am facing right now is that I don't know how to show that list (List is not displayed when app UI shows for first time). And size of list will incr...

Android Get Screen dimensions from Service

Hi Guys though i got the Screen Size by using the following from a activity, Display display = getWindowManager().getDefaultDisplay(); But the same thing is not working from a service (for obvious reasons, i know!) but i desperately need to get the display size from a service. Can some1 please explain me any other way for getting the ...

how wifi ,bluetooth images are displayed top of the screen Android?

Hi, Iam obeserving that whenever Wifi is enabled from my device , wifi images is dispalyed top corner of the screen.If i disable wifi then it dissappear.Please send me sample code on this? 2) How can i use sdk versions apk's into my own project and is it possible to access that apk java methods from my own project.If yes please give me ...