android

Is GoogleAnalyticsTracker.getInstance() required for tracking referrals?

I'm trying to track whether people have found my Android app from an ad, or elsewhere. So I found that google analytics can keep track of that via the carefully constructed url generated by this form: http://code.google.com/mobile/analytics/docs/android/#android-market-tracking which would look something like this: http://market.andro...

Two children for ScrollView?

I am trying to create a very simple application (part of my learning program), vertically oriented, with an EditText at the top that receives a URL, and two buttons side by side just below that say "Get Image" or "Get Text" depending on the URL typed in (.html vs. .png, for example). The resulting elements may be later scavanged for use ...

Can you upgrade sqlite3 version on your android?

Hi I'm writing an app which uses the Foreign Key Constraints which support was only just brought in for on version 2.2, and my phone is 2.1 Is there any way to upgrade the version of sqlite3 on the htc desire or any other android phone when your application installs? ...

Read/Write SD card always throw IOException

It's a special SD card, with an encryption chip on and some COS run on it. When I use USB debug mode, everything works fine. But after I unplug the cable, when I do the read/write to the SD card files again, it throw IOException everytime. And I found that when I plug the charger it works fine too. Is there some settings reasons about th...

Eclipse Android project

I have a problem I can't seem to get around. I've created a project in Eclipse (I recreated it from another project that I thought was corrupted). There are no visible errors in any of the files, including the .xml files. However, the project root [project name] itself has an error (red 'x') and so I can't run it. On a side note, in th...

How to make HTML links in a listView Item focusable?

I wanna make an app which is quite similar to the official twitter client for android. In my listView Item ,there is a TextView which has some html content,I hope the links within it can be focusable and clickable,I have used: getListView().setItemsCanFocus(true); but it still doesn't work,I don't know why. the layout is like this: ...

Newb to Declaring Variables - Wanna help?

Hi everyone, yep, this is a total newb question, I've "RTFM" but I still don't understand, concepts like this just don't exist in the languages I'm used to programming. Anyway, my question is simple: how does one properly set a global variable which can be used by all public void functions inside that class? Here is some example code, ...

Can't deploy Android/Google Maps app from eclipse

I'm an android newbie having a lot of troubles with the android emulator. I have inconsistent luck in starting up the emulator, and no luck if I start it from within eclipse instead of from the commandline (it waits forever and never boots -- not even after 24 hours). However, since I figured out how to get it to (sometimes!) start fro...

Having trouble animating listview layout

I want the items in the listview to slide in one at a time from left to right. I have the following in res/anim/slide_right.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"> <translate android:fromXDelta="100%p" an...

How can I check if a string I have returned from a cursor is emtpy or null in an Android cursor?

This is my code, it always falls into the else even when I know that the value going in (via debugger) is emtpy. name = cursor.getString(cursor.getColumnIndex("Genus")) + " " + cursor.getString(cursor.getColumnIndex("Species")); if(name != "" && name != null) tv.setText(name); else tv.setText("Error"); ...

Is it possible to use GoogleFinanceAPI on Android?

I've been searching around for a definitive answer but have yet to find one. It seems as though the simple answer is "no" because the GoogleAPIs use too many Java classes that aren't included in Android. If that's the case then I need to ask another question: what is the best way to parse information from "http://www.google.com/finance/...

What's wrong with my code?

There is a null error, and i've been trying to solve it for 2 days. Booking.java package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; import android.w...

Android: How to pass Intent via startActivity() to a running Activity?

Say MyService and MyClient are both running, although MyClient is currently in the background. If MyService sends an Intent to MyClient via: Intent i = new Intent(MYService.this, MyClient.class); i.setAction("com.test.MyService.ACTION_SERVICE"); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_AC...

How can I control the flashlight on the phone?

When I do some research on the Android SDK website, I know that I have to grant the permission "FLASHLIGHT" in order to use the light. However, I cannot find in the API any methods to control the flash light. But I believe there is a way because I can see so many apps doing this in the Android Market. How can I do so? ...

Bitmap OutOfMemory on Multiple Screen Changes

I have a bitmap that I load from the SD card by allowing the user to choose a picture to display. Once the bitmap is created, I set the Bitmap in an ImageView: mBitmap = Bitmap.createBitmap(Media.getBitmap(this.getContentResolver(), mPictureUri)); mImageView.setImageBitmap(mBitmap); This works fine. But, if I change the screen orienta...

Android - detect phone unlock event, not screen on

Is there a way to detect when a user unlocks the phone? I know about ACTION_SCREEN_ON and ACTION_SCREEN_OFF, but these seem to be fired when the screen switches on/off on pressing the power button, but not actually when the phone gets unlocked on pressing the Menu button... Edit: I am trying to detect the unlock/lock while an activity i...

Textview on left side with button on right side non absolute values

I'm trying to get my textview to hug the left side of the screen while the button hugs the right side (and if possible just for ocd sake have the text view center itself vertically to be in line with the button) but not do it using absolute values. Here's my coding: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="htt...

Facebook page doesn't redirect

Hello, I just want to redirect a facebook page in my android application but each time its asking for login detailes and when I m already login it does not redirect to my facebook page URL it opens my profile. Anyone have solution please? Thanks. ...

diffrence between dvm and jvm

what is diffrence between jav and dalvik machine? ...

Returning an XML file from a web service to android device ?

I have a set of mp3 files on my computer which i want to be the server. Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server. I have a small problem : How does my web service get the list of audio file...