android

Dynamically sizing Views as a percentage (or similar)?

To use as an example: lets say that I have 2 EditTexts and one Button that I'm using as a login form. I want the EditTexts to be the same size, one after the other, with the login Button half their widths. Something like this: The only way that I've been able to find to make the button 1/2 the width (but still maintain it's dynamic si...

Android TelephonyManager.getNetworkType() returned constant values in bearer speed order?

TelephonyManager.getNetworkType() returns one of the constant values. It appears that the constant values have an integer order, by possible bearer link speed. I know using constant values used in the following manner is generally bad, however could one use this to determine a basic cutoff for application functionality and have it wor...

How to get the font face size and formatting of a native element in Android application?

I would like to reuse the exact same font-face etc... like Android uses in the PreferenceScreen Here is a screenshot I am looking to reuse the title, and the summary style from these views. ...

Android Slide Menu as Home

Hi, is it possible to create a menu similar to the one that appears in home screen of Android? Thanks ...

Multiple instances of the same android widget: Anyway way to have instance specific preferences?

I am creating a simple Android widget with a typical usecase of having many instances of it running at once. Using the stock preferencesmanager, it seems each instance of the widget shares the same preferences. Is there any way to not have this happen? Thanks! ...

How to test for the appearance of a Toast message

Would anyone know how to test for the appearance of a Toast message on an Activity? I'm using code similar to what the OP posted on this question for testing my program flow from one activity to the next. I'd also like to be able to test for toast messages on particular activities. ...

How to start an Intent by passing some parameters to it?

I would like to pass some variables in the constructor of my ListActivity I start activity via this code: startActivity(new Intent (this, viewContacts.class)); I would like to use similar code, but to pass two strings to the constructor. How is possible? ...

Possible to use null layout in Android?

Is there an equivalent to Java's null layout in Android? Basically I want to specify the x and y coordinates of each component and not have the layout manager choose where they go. They will be within a scroll pane so it doesn't matter whether they fit on the screen. I know null layouts are generally not a good idea but I have a speci...

How to generate a random number, then display it on screen?

Ok, im fairly new to android but i have managed to teach myself the basics, i am making an app where you press a button , and a new screen opens and it shows a randomly generated number, the only problem is i dont know how to generate and display the random number, i have been searching the web for ages and have only found little snippet...

How do I make Views fill the full width of their parent in my Android app?

I have the following layout defined for one of my Activities: <?xml version="1.0" encoding="utf-8"?> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"&gt; <TableRow android:id="@+id/TableRow01" android:layout_...

How did the Lunar Lander example make the image backgrounds transparent?

Hello. I'm trying to make a GUI program with the Android SDK, using their Lunar Lander example as a significant self-teaching tool in the process. I've noticed their sprites' images' backgrounds, which were at least usually pure white, did not show up in their program. I want to ask how they did that, since their site doesn't explain ...

What is the best way to profile a mobile Web Application?

I am looking to profile my web application on Android for starts...what is the best way to get the kind of information that a tool like Web Inspector would give me on the desktop? Since I cannot use Web Inspector or Speed Tracer on the mobile device...how can I get such data/info ? ...

Android: How to prevent image from being scaled in ImageView or ImageButton?

Hi, How can I prevent my bitmap from being scaled automatically in an ImageView or ImageButton if the view or button is stretched using "fill_parent" or using "weight"? This will be useful, for example, to create a 4-button toolbar at the top of the screen where the buttons are equally spaced, but the images inside the buttons keep g...

Does setWidth(int pixels) use dip or px?

Does setWidth(int pixels) use device independent pixel or physical pixel as unit? For example, does setWidth(100) set the a view's width to 100 dips or 100 pxs? Thanks. ...

Switching views in ViewFlipper

Hi, Is there a way to switch views in a ViewFlipper just like on Home screen, where we have small dots at the bottom of the screen and on clicking on them we can switch views. Thanks, Farha ...

Is there any way to Intercept incoming calls/sms to either block/unblock it?..Android

hi Is there any way to intercept incomming calls/sms (to block or unblock it) on the basis of mobile numbers which are added to screening list. Thanks in Advance... ...

Android save Checkbox State in ListView with Cursor Adapter

I cant find a way to save the checkbox state when using a Cursor adapter. Everything else works fine but if i click on a checkbox it is repeated when it is recycled. Ive seen examples using array adapters but because of my lack of experience im finding it hard to translate it into using a cursor adapter. Could someone give me an example ...

Lots of users still using 1.5?

Hi, I'm looking at market stats here for sdk distribution: http://developer.android.com/resources/dashboard/platform-versions.html saying that 31% of marketplace users are still running 1.5. Is it true that an OS update went out for G1 and myTouch users? I'm wondering why so many people are still running 1.5 if so? Just curious becaus...

share feature of menu in android application

Hi, i asked so many question regarding my title but i could not get my proper answer till yet.I need to implement androd's menu feature in my application ie when we goes to gallery in android phone, when we press menu than it comes with lots of option like share...etc.My question is can i implement same menu feature in my application? It...

When to use new layouts and when to use new activities?

I'm making a game in Android and I'm trying to add a set of menu screens. Each screen takes up the whole display and has various transitions available to other screens. As a rough summary, the menu screens are: Start screen Difficult select screen Game screen. Pause screen. Game over screen. And there are several different ways you c...