android

Make a wizard like application in Android

Which you think is the best way of doing a wizard like application (user can navigate between screens with a next and back button, and each screen has to save some state data) in Android platform. I mainly can think in two approaches: Having one activity+view for each screen and then i make the screen switch by calling each activity. ...

Creating categories in a ListView?

How do I create categories in an arbitrary ListView like those in Preferences (PreferenceCategory)? I've found android.R.layout.preference_category that renders that grey TextView but don't see it mentioned anywhere from java code. ...

App that makes phone calls and stores data for iphone, Android and blackberry?

Hi, The app I'd like to build aims at giving contact information of a person using a search engine. This is the basic feature. To make it more appealing, I'd like to add those enhancement features: (1) allowing making a phoning call to the contact (when pressing a button for ex.) (2) allowing the user to store contact information th...

Why is my animation leaving a trail?

I'm animating a an ImageView from the left to the right of the screen using a translate animation. The ImageView is place inside a RelativeLayout over the top of my main layout using FrameLayout. When I run the animation on the emulator everything works pretty well but when I use run it on my G1 it leaves visual artifacts behind and ef...

On blackberry and android : calling native application from a web browser ?

Hi, I'd like to know if it's possible to associate a protocol (for example: 'myapp') to a native application installed on a Blackberry (or Android) so that if a user types in 'myapp://xxx' in a web browser it calls the native application. In this case, how is it possible to achieve it ? As far as I understood, it's possible to do it wi...

Is there a working sample for the Android 1.5 VideoView/MediaPlayer class?

Hi folks, I'm new to Android dev. There's a very pretty state diagram of the MediaPlayer, but I can't for the life of me figure out how to actually use this class to play a video. There's a view samples around the 'net, but they seem to be for previous versions of the SDK. I've also checked the official samples, but with no luck. ...

Android: How to get screen dimensions

Hi, I created some custom elements and I want to programatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge) therefore I need to get the screen width and screen height and then set position: int px = screenWidth - m; int py = screenWidth - n; Does anyone know how to get screenWidt...

Android: How to redraw a graphic element?

Hi, I have created a class RoundIcon which extends View and the class contains setIconImage() method: public void setIconImage(int imageFromResources) { iconImage = BitmapFactory.decodeResource(getResources(), imageFromResources); iconWidth = iconImage.getWidth(); iconHeight = iconImage.getHeight(); refreshDrawableState(); } and ...

@ in AndroidManifest.xml file

From the O'Reilly book "Android Application Development " by Rick Rogers, John Lombardo, Zigurd Mednieks & Blake Meike: page 23: <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> page 44: <application android:icon="@drawable/icon2"> What is the meani...

AndroidManifest.xml <manifest> package attribute has no namespace.

From the O'Reilly book "Android Application Development " by Rick Rogers, John Lombardo, Zigurd Mednieks & Blake Meike: page 44: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microjobsinc.mjandroid" android:versionCode="1" android:versionName="1.0"> The XML code above has the package attrib...

AndroidManifest.xml file <manifest> versionCode attribute

Versioning Your Applications on the Adroid developers web site: you would release the first version of your application with versionCode set to 1, then monotonically increase the value with each release, regardless whether the release constitutes a major or minor release. That is all nice and well but how is one to handle...

Refresh a view Android

Hi, I want to refresh a listview . when i am getting a value from different class i want it to update that to list view . I am creating a thread for refreshing the list but i am getting an exception Only the original thread that created a thread a view hierarchy can touch its views . how to proceed Thnx in advance ... ...

On Android : making a phonecall using a browser application

On Android mobiles, does anyone has checked that if a user clicks on a link <a href='wtai://wp/mc;5551231367' title='Call'>555.123.1367</a> this would propose the user to make a call to this phone number ? If not, do you know how is it possible to do it ? ...

Copy a CharArrayBuffer to another CharArrayBuffer

How can I copy a CharArrayBuffer to another CharArrayBuffer at a specified index in Java on android? developer.android.com/reference/android/… CharArrayBuffer stringBuffer1 = new CharArrayBuffer(128); System.arraycopy("Phone", 0, stringBuffer1.data, 0, "Phone".length()); But i get an ArrayStoreException. I have allocated the CharA...

How would you improve Dalvik? Android's Virtual Machine

Hi All, I am currently writing a paper on the Android platform. After some research, it's clear that Dalvik has room for improvement. I was wondering, what do you think would be the best use of a developer's time with this goal? JIT compilation seems like the big one, but then i've also heard this would be of limited use on such a low...

Killing android application on pause

Hello. I have an application which I would like to be fully disabled/closed when it is paused (IE. When the user presses the Home, End (call) and Back button I would like the application to be closed, instead of being saved in the history stack). How do I do this....? Thanks. ...

How can I switch adapter for a Gallery

Hi, Is it possible for me to dynamically switch the adapter of a Gallery? In the onCreate() of my activity, I did this: myGallery.setAdapter(adapter1); And then later on in my code, I did myGallery.setAdapter(anotherAdapter1); I tried, that but in the emulator, the myGallery never gets update when I do 'setAdapter' again. How can I f...

PostMessage() alternative in Java(Android)

Hi, I am rewriting the existing C++ application and adapting it for Android environment. In the code there is a PostMessage statement: PostMessage( bExitApp ? WM_CLOSE : WM_LOGIN, wParam, lParam ); Does anyone know what is the most appropriate way to achieve tha same result in Android (Java)? Is it well enough to create two methods...

Android - what's the difference between the various methods to get a Context?

In various bits of Android code I've seen: public class MyActivity extends Activity { public void method() { mContext = this; // since Activity extends Context mContext = getApplicationContext(); mContext = getBaseContext(); } } However I can't find any decent explanation of which is preferable, and u...

PopUp dialog Android from background thread

hi, I need to popup dialog to be showed when i get a message from differnt thread but the dialog should be not dependent on Activity i.e, it should display the dialog wherever the screen focus is .can it be done ..because the dialog is handled per Activity ,i thought of using service but again it would be one more thread added so ...