android

Error converting replicasisland from SVN in Eclipse to an Android Project

I have been trying this for hours without success. http://replicaisland.googlecode.com/svn/trunk/ I have added the repository and successfully downloaded the project into the workspace using the option "check out as a project in the workspace" calling it replicaisland. I tired using the option "check out as project using the New Confi...

Error inflating basic framelayout only in Android 1.5

Hi, I have the following layout in XML (splashscreen.xml): <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/frmLayout" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/splash" android:...

How can I put a ListView into a ScrollView without it collapsing?

I've searched around for solutions to this problem, and the only answer I can find seems to be "don't put a ListView into a ScrollView". I have yet to see any real explanation for why though. The only reason I can seem to find is that Google doesn't think you should want to do that. Well I do, so I did. So the question is, how can yo...

Rotate Bitmap on Android Canvas

I have some objects which I draw onto a Canvas as part of a SurfaceView. I want to be able to rotate these programmatically, e.g. myParticle.setRotation(90); Here's my (simplified) code to draw the Particle at the moment: public class Particle { public void draw(Canvas canvas){ image.setBounds((int)(xPos), (int)(yPos), (int)(xPos...

Listview items appear under tab in tabview

When this displays the first two rows of the listview appear under the tabs, the Mercury, and Venus planets. How do I get the tabs to occupy the top and the listview rows to start after the tabs? tablistmenu.xml: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="...

How to update a CursorAdapter tied to listview when number of items changes?

I have a ListView backed by a custom adapter based on a CursorAdapter. The cursor I give it is based on a list of Notes in the database (each note is a DB row). Everything works just fine until I delete a note from the database. I'm not sure how to properly update the cursor/adapter/listview to display the new data. I've read conflic...

Should I learn Java before learning Android

Should I learn Java before learning Android or I can do both things in parallel? What is the best approach? ...

how to put a border around an android textview

Is it possible to draw a border around a textview? ...

Android / Java - How do I call upon a function in a separate *.java file?

I do an import of the full package name / java file, and if I do a <classname>.<method>, SOMETIMES I can get it to access - other times I get a lot of can't use a static in a non static bunch of talk. I'll admit I'm new to Java, so what do I need to do? Call a class instance first, then call my methods? I'm rather confused by this, a...

Android trackball events while screen is off.

I'm looking for a way to grab trackball events while the screen is off, preferrably on a N1. I'm building my own music player and would love to add the feature to skip songs by trackball press, without having to unlock my device everytime. I've found TrackBallSkip, however the source code has been taken down and integrated into Cyanogen...

How can I view my Android Apps database information?

I've tried to view the db file from the File Explorer in Eclipse but I can't open the file or copy it to another location to open. I don't have a rooted phone so I was trying to view the db from the app on my emulator. If someone could help it would be greatly appreciated as I find it hard to find much info on this subject for some reas...

How to set focus on a TextView when an Activity starts?

There are an EditText and a TextView in my Activity. I want to set focus on the TextView when the Activity starts. I used the following code: TextView myTextView = (TextView) findViewById(R.id.my_text_vew); myTextView.setFocusable(true); myTextView.setOnClickListener(this); myTextView.requestFocus(); But the code doesn...

getRingerMode () always returns a value of 0

Hello. I'm trying to determine the current ringer state by using the getRingerMode() method. I create a variable: private int currentRingerMode; Set my variable to: currentRingerMode = getRingerMode(); And use a methods as follows: private int getRingerMode() { // TODO Auto-generated method stub return currentRingerMod...

What is the proper way to dim the screen?

I have seen 2 methods so far in my search, both of which I am having trouble with. Method 1) Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 100); Method 2) IHardwareService hardware = IHardwareService.Stub.asInterface(ServiceManager.getService("hardware")); hardware.setScreenBacklight(.5); Which o...

Low-resolution (ldpi) Android icons

On the topic of included standard icons the Android documentation mentions that: Shown below are standard menu icons that are used in the Android system. Because these resources can change between platform versions, you should not reference the system's copy of the resources. If you want use any icons or other internal d...

Why is the parcelable object null in receiving activity?

I am following the Parcelable example in the Android developer guide with the intention of having a more complex object that I send to different activities. Right now, my class is a wrapper of a String member. If I put the object in the intent and read it back from the Intent it reads as expected, however, on the receiver side, it is ...

how to select from resources randomly (R.drawable.xxxx)

hello, I want to display a random image from the bunch of images i have stored in res/drawable. The only technique that I know is to access a particular image if you know its resource id. Is there a way to access the images by using the filenames or something else (which can be constructed at runtime)? I want to randomly select an ima...

Memory leaks with HashMap/HashSet on Android

I have an Android application where I use HashMap where I keep my Threads (values) each executing a task (Runnable). To identify the Threads I use Strings as keys. The Threads are alive as long as they execute a task what is usually not very long. The problem is that they seem to never been released by GC after finishing and being remove...

Application does not work when on 3G.On WiFi works fine

I have application that communicates with web server through REST. It works fine on a phone when connected via WiFi but does not work correctly when on 3G. Not everything stops working. I'm still able to use some functionality but for some reason some calls to rest return "" (empty response) very quickly. Once again when I'm on WiFi eve...

ImageView onClickListener changing the image source

Im working on changing the image being shown when I have my ImageView Clicked. Im trying to use a similar code that I used for accomplishing this with a TextView but I can't seem to find the right terms to get it to work. Here is my current code. Thanks electronconfiguration.setOnClickListener(new View.OnClickListener() { publi...