android

Accesing contents of res/raw programatically (Android)

Hi Friends, I'm working on an app for Android with a few other people, and the primary content is specified by our designers as text files in a certain file format, which we then parse, process, and serve in the app. We're currently storing them in res/raw. This makes things great for the designers because when they want to add conten...

Displaying a DatePicker with or without the year field

Hi All, I would like to display a DatePicker where the year field would be visible or not, according to a checkbox. But I didn't find anything giving me a way to implement it. Any idea please ? Thanks in advance. ...

Tabs very dark on API level 5, but used to be lighter with API level 4?

I've been using API level 4, and I am moving to level 5. I had a tab widget in my activity. The tabs used to be pretty light greys. After moving to API level 5, they are quite dark. The unselected tabs are almost black! I've tried setting the theme to light, but the colors remain very dark. What is the reason for this? ...

[Android NDK] Using OpenCV Android porting

Hi everyone!!! I want to use the OpenCV Android porting, that you can find HERE, to make some image transformations for an Augmented Reality application. I've found no problem configuring and building the library, I receive no error and I succed put it within my Android application throght JNI process: the library libopencv.so is in the ...

Android phones: how does the video out feature work?

Hi, I'm searching for android phones that can use video out to the tv for a research project. I'm considering the HTC Touch Pro. Is there anything I have to do specifically to get the video out to work (for displaying my app on the tv)? or will the phone just display a running app on the tv without extra work? Thanks, I hope the post ...

Android relative layout problem with gravity

How can i put textview with id="naslov" to the center? I also tried with layout_gravity="center" but that doesn't work either. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/naslov" android:layout_wi...

how to change the color of the tabs indicator text in android?

how to change the color of the text indicator of tab? i can change the icon using selector tag refered the example. but cant to the text color. how? ...

Android: grab a piece of an ImageView

I have an ImageView from which I want to copy a piece of it in the shape of a circle that I can then re-display to the user at a larger than original size to simulate a zoom effect. Would I use bitmaps for that? Thanks. ...

Problem with sizes of EditText and Button in Android

I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" />...

Listing like appstore in firefox or any other browser for windows/desktop linux

A little question about the listing in iPhone OS and some other applications, and possibly in Android Market. When listing the apps, it fills the list in an automatic process, when reaching or is near to reach the end. My question is: How is that written in iPhone applications. But the main question is: Is that possible to make for Fir...

Android Marketplace, how would I email a link that would open the Market place from a device?

I want to offer a webform on my app's website that sends an email to the provided address, that if opened from a Android device would launch the marketplace on the phone. I have used the following: http://market.android.com/details?id=package.apk It takes me to a loading screen, but I get Sorry, the application Market (process.com.a...

Android ProgressBar.setProgressDrawable only works once?

In a color picker, I have 3 SeekBars for Hue, Saturation, and Value. Calling setProgressDrawable on these SeekBars only works once -- at initialization from onCreate. When the user updates the Hue SeekBar, I want to call setProgressDrawable for the Saturation and Value SeekBars, to show the user their color choices for the new Hue. Bu...

ANDROID. Emulate Hardware Keys with an IME. Doesn't work with Dialog and Spinner

I have understand that the only way to inject KeyEvents in the Android System is to implement an Input Method. I have created my IME with the purpose to control from remote the device. I emulate the hardware keys using the method private void keyDownUp(int keyEventCode) { getCurrentInputConnection().sendKeyEvent( ...

Android : Cannot cast from View to Button

I just started working with the Android, but seem to have come across a problem that I simply can't find the answer to. I get the error "Cannot cast from View to Button" on this line : Button myButton = (Button)findViewById(R.id.my_button); I've tried many different things to get it going, and I've searched for the answer, but for so...

How do I declare "Member Fields" in Java?

This question probably reveals my total lack of knowledge in Java. But let me first show you what I thought was the correct way to declare a "member field": public class NoteEdit extends Activity { private Object mTitleText; private Object mBodyText; I'm following a google's notepad tutorial for android (here) and they simply said: "...

Why are the last two tabs in an android app doing the same thing?

I'm working on adding a tab to an application, but the last two tabs (regardless of order) are launching the same activity. If I go down to two tabs they both work correctly, but when I add the third the last two result in the same activity launching. Any suggestions? public void uiConnected() { Log.d(TAG, "UI Connected"); tabH...

How can I unit test an Android Activity that acts on Accelerometer?

I am starting with an Activity based off of this ShakeActivity and I want to write some unit tests for it. I have written some small unit tests for Android activities before but I'm not sure where to start here. I want to feed the accelerometer some different values and test how the activity responds to it. For now I'm keeping it simp...

Thread used for ServiceConnection callback (Android)

Hi I'm developing an activity that binds to a local service (in onCreate of the activity): bindService(new Intent(this, CommandService.class), svcConn, BIND_AUTO_CREATE); I would like to be able to call methods through the IBinder in my lifecycle methods, but can not be sure that onServiceConnected have been called prior to these...

Dealing with Android devices that don't need a SD card

It seems that some Android devices like the HTC Incredible and the Archos 5 IT don't need a SD card for storage. How should apps that read and write files to "external" storage (so far the SD card) deal with this in the most backward and forward compatible way possible? Edit: Getting more reports about devices that use onboard memory a...

Screenshot of the Nexus One from adb?

My goal is to be able to type a one word command and get a screenshot from a rooted Nexus One attached by USB. So far, I can get the framebuffer which I believe is a 32bit xRGB888 raw image by pulling it like this: adb pull /dev/graphics/fb0 fb0 From there though, I'm having a hard time getting it converted to a png. I'm trying with ...