android

Are there any good short code examples that simply read a new gmail message?

I have been trying to write an app that periodically parses the contents of gmail messages. I have been through the JavaMail FAQ and I have looked at a number of examples in the JavaMail download package but have been unable to get this to work. The code below currently causes the following gmail error: Host is unresolved: imaps.gma...

APIDemos 8 Animation (Under menu App then Activity) goes not go to the animations.

Setting a debug toggle at the startActivity does not take you to an animation but the "Views/Controls/1. Light Theme" screen private OnClickListener mFadeListener = new OnClickListener() { public void onClick(View v) { // Request the next activity transition (here starting a new one). startActivity(new I...

Making code stuff pretty (layout)

So I have made a little piece of code that will insert and manipulate a few images. Now my main problem is that this is very ugly and long, I was wondering if anything could be done to make it prettier. RelativeLayout mRelativeLayout = (RelativeLayout) findViewById(R.id.board); ImageView i = new ImageView(this); i.setImageR...

Android: Connecting webview with camera

I'm having difficulty setting up the webview so that there can be javascript callbacks to access the android camera. Has anyone done this before, or have any advice? ...

Simple android 2.2 programming question

Sorry I'm really new to this, but I can't find anything in the docs. I have 3 .class files that I'm attempting to use in an android 2.2 project, but I don't know where to put them so that I can import them, for some reason Eclipse won't allow me to put them in the android 2.2 folder (it seems to be unwriteable) So where can I put these ...

Android - How much space does a TextView take

How much space does a TextView take? When I declare a TextView, is it possible to calculate how much space (height and width) it is going to take when actually rendered on the phone? I have noticed that based on the different screen sizes of phones (or density), the TextView is rendered accordingly. I want to be able to calculate the e...

Android: How to get the sender of an Intent?

Is there a way for an Activity to find out who (i.e. class name) has sent an Intent? I'm looking for a generic way for my Activity to respond to a received intent by sending one back to the sender, whoever that may be. ...

How can you configure an EditText's soft keyboard to use numbers initially, but still allow text?

I want to let users input a postal code to my app. The common use case is the US zip code, which are composed solely of numbers, so I'd like to display the numeric keyboard initially in the soft input. However, not all postal codes are solely digits, so I still need users to be able to enter other characters. I've been trying to do th...

Swap two buttons positions in TableLayout

Suppose I have the following layout <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout"> <TableRow android:id="@+id/TableRow01" > <Button android:text="1" android:id="@+id/button01"/> <Button android:text="2" android:id="@+id/button02"/> <Button android:te...

Writing authentication system

I am currently writing the backend for a service which has 3 clients: browser, android native and iphone native. I am having a little trouble with coming up with an authentication system since I don't know what can really be done on the clients. I am using django + twisted for the backend. Basically, I am going to be writing RestfulAPI...

Optimizing Android testing effort

4 major OS versions: 1.5, 1.6, 2.1 and 2.2 (I guess we can safely ignore 1.0 and 2.0 now) 3 screen densities: ldpi, mdpi, hdpi 3 screen sizes: small, normal, large Lots of system testing scenarios. Is there are way to optimize the testing effort for an app that has to target all Android devices? What's the minimum number of emulators...

Reverse image load order?

First Question I use http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 to load images in a ListView and a GridView. It works but the images are loaded form bpttom to top. How to fix that? Bonus Question Can I use a loading animation in a image view while the real image is ...

android 2.2 WebView and WebViewClient RTSP problem

I wrote an app with webview which displays m.youtube.com. It works in other android versions. However, in Android 2.2, shouldOverrideUrlLoading is not even called when a link like "rtsp://vx.cache.youtube.com/..." is clicked. Does anyone have the same problem? ...

How to get the list of running applications.

Hello everyone, I am working on an app which needs the information of the apps running at the system up to now, I am wondering is there a api/method to retrieve that kind of information? Thanx in advance. ...

Android Camera Preview question

Hello all. I am writing a program to study Android Camera functions. Now, I have some problems about Camera preview operation: My program will create a surfaceview object in the main activity (ActivityMain)'s onCreate() function and then set it to the content. super.onCreate(savedInstanceState); m_surface = new MyCameraSur...

How to obtain pixel's rgb values in an image in android

Hello, I am working on a little side project (program for Android platform)and I don't exactly have a problem, but I don't really know where to start. The project I am working on has to do with getting the info and manipulating a pixel's RGB values inside an image. I know this is a very basic program (not going to disclose all the info...

Is there any easy or automatic way to specify text color selector for click event?

I specified a selector drawable for the background of a layout as below, so when user clicks on the layout, the layout will have a different background. But, I didn't specify color selector for the TextViews in the layout, because there are many TextViews with different colors and I am too lazy to define color selector for them. So the t...

build android system on ubuntu 10.04 x86-64 occrur internal compiler error

I'm trying to build android system ; enviroment: ubuntu 10.04, gcc-4.4 jdk 1.6-0-20 get source code follows http://source.android.com/source/download.html $ . build/envsetup.sh $ choosecombo $ make then compiler error occurs: frameworks/base/opengl/libagl/egl.cpp:1955: instantiated from here frameworks/base/opengl/libagl/egl.cpp:...

disable/enable notification led

Is it possible to programmatically disable and enable the led indicator light on an Android device? I am not referring to just turning it on and off as in a notification. I did not see anything in the api that would do so. I am guessing this is hardware specific if it is possible at all. ...

How to make notification intent resume rather than making a new intent?

What i have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can just close the notification by hittin...