android

Key event handling process

I'd like to know how the key event is handled in Android platform. From 'when user type key 'a' on software keyboard', To 'view draw the character 'a' on itself'. Probably, the key event is generated by IME, And it will be sent to parent view, Finally, view(such as EditText) displays chracters. Please somebody explains about these enti...

Any simple shape recognition libraries for Java?

I am working on a on-screen keyboard for Android, and I need to recognize starting points, turning points and end points of lines drawn by the user on the keyboard. A simple straightening function would be nice, as it is difficult to draw a perfectly straight line even with a stylus, not to mention finger-only touchscreens today. What I...

Android new Intent

Hi Im trying to start android market via my app to search similar products. I'm using this code. Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://market.android.com/search?q=pub:\"some txt\"")); c.startActivity(intent); This works fine but when I hit on Home button with in the market and goto home phone home s...

Android:Where is exactly Android 1.6 SDK download?

Hello friends, I want install Android version 1.6 SDK. I already have Android development setup with Eclipse and Android 1.5 SDK. Wherever i search in Google to download Android 1.6 SDK, it finally goes to link: http://developer.android.com/intl/zh-CN/sdk/index.html This link has three setup SDK zip files, but no where mentioned what v...

How to show own view in Spinner Widget instead of Text View?

I have a selection for some items using a spinner widget. At the moment the spinner will load a simple Textview and show the name of the item. It is possible to define an own view to show inside the spinner row? I would suspect it being similar to a custom List row. I simply want to show an individual icon left from the spinner text f...

Android AppWidget TextView: How to set background color at run time

I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval. The TextView is defined in layout xml file as <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layo...

Android: How to find the position clicked from the context menu

Hi, I have a list view filled with data. I set up a context menu for the listview using the following code: list.setOnCreateContextMenuListener ( new View.OnCreateContextMenuListener() { public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { AdapterContextMenuI...

Fetching data (responsebody) with a HttpClient in an AsyncTask and returning the data outside the AsyncTask to the UI-thread

Basically I'm wondering how I'm able to do what I've written in the topic. I've looked through many tutorials on AsyncTask but I can't get it to work. I have a little form (EditText) that will take what the user inputs there and make it to a url query for the application to lookup and then display the results. What I think would seem t...

OnTouchEvent in a MapItemizedOverlay

Hi, newbie here ... I have a MapView with a MapItemizedOverlay, like this : Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker); itemizedOverlay = new MapItemizedOverlay(drawable); OverlayItem overlayitem = new OverlayItem(p, "", ""); itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedO...

Android emulator: How to monitor network traffic?

How do I monitor network traffic sent and received from my android emulator? ...

Help getting array from arrays.xml file (Android, Eclipse)

I am just trying to display a list from an array that I have in my arrays.xml. When I try to run it in the emulator, I get a force close message. If I define the array in the java file (String[] testArray = "one","two","three","etc";) it works, but when I use "String[] testArray = getResources().getStringArray(R.array.testArray); " it ...

How do I place widgets above and below a listview?

I have a list view and want to put stuff both above(on the y axis) and below(y axis) it including images, text views, and a row of buttons. Below is a simplified version of what I am creating. Unfortunately the list covers(i.e. above on the z axis) the header so the header text is not visible instead of being underneath (on the y axis)...

Android:Playing AudioTrack multiple times producing crash

Hello friends, I am trying to play audio buffered sound (.wav) using AudioTrack. Please see the code below. I need to call this function under a Thread to support simultaneous play. It is fine being under a Thread. It is working fine playing the sound normally. But if i execute playing the sound using AudioTrack one after another contin...

Why is my onItemSelectedListener not called in a ListView?

I'm using a ListView that is setup like this: <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:longClickable="false" android:choiceMode="singleChoice"> </ListView> In my code I add an OnItemSelectedListener to the ListView like this: getListView().setAdapte...

Android: building different versions of my app (free, premium, etc.) with Eclipse

With my current code base I'd like to build two or more different versions of my Android app (free, premium, ...). For the iPhone (XCode) I can definte different targets. Is there something similar implemented in Eclipse? ...

Access Assests from another application?

I get a lot of requests in my application to allow for custom icons packs from BetterCut / Open Home. The way it seems to work is you install BetterCut or Open Home, then you can install tons of these free icon packs from the market. Once installed both those apps (and other apps) will poll for those icon packs and use the icons. I w...

Best practices for developing bigger applications on Android

I've already written some small Android Applications, most of them in one Activity and nearly no data that should be persistent on the device. Now I'm writing an application that needs more Activities and I'm a bit puzzled about how to organize all this. My app will download some data parse it show it to the user and then show other ac...

How is the Viewflipper handling the back button in Android?

I'm thinking about using a ViewFlipper for an Wizard like Activity. But I see one problem with this approach. The back button. Will the back button go back to the last shown activity or will the the Viewflipper somehow catch the back button event and only change to the last shown activity? I suspect the ViewFlipper to be treated as one...

Creating a iPhone like roller using ListView

I want to create a better NumberPicker then the one used in DatePicker, I looked at the HTC Sense Alarm clock Roller (Looks like the iPhone Spinner/Roller). I want to create something like that. I've created a listView that looks right, but I need a way to get the current id of the middle row. ListView.getFirstVisiblePosition() kind of ...

Writing a file to sdcard

I'm trying to write a file from an Http post reply to a file on the sdcard. Everything works fine until the byte array of data is retrieved. I've tried setting WRITE_EXTERNAL_STORAGE permission in the manifest and tried many different combinations of tutorials I found on the net. All I could find was using the openFileOutput("",MODE_WO...