android

Querying SQLite DB in Android Activity - saying no column found, although it exists

See title for explanation. Here is the method I'm using: public Cursor getClientByName(String name) throws SQLException { name = name.trim(); Cursor mCursor = mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NAME}, KEY_NAME + "=" + name, null, null, null, null, null); if (mCursor != ...

How to implement an Android PerformanceTestCase using Intermediates

Hi, Can someone tell me how to write an Android PerformanceTestCase using Intermediates? I got the code snippet below for my activity and execute it via the adb shell: adb shell am instrument -w -e perf true org.foo.test/android.test.InstrumentationTestRunner My code: public class PerformanceTest extends ActivityInstrumentationTestC...

Android ListView Jump to cursor position

I have a ListView that is controlled by a standard BaseAdapter. When the user clicks a button, I want the ListView to Scroll into view the 100th record. How is that done? ...

How to prevent ad blocker from blocking ads on an app

One of my users let the cat out of the bag and told me they were using one of my free apps, which is monetized by ads, but they were blocking the ads with an ad blocker. They told me this mockingly, as if I can't do anything about it. Can I do something about it? Is there a way to detect that ads are being blocked? ...

How might one create a large Bitmap in Android?

I am trying to build an Android application which can take several photos taken by the camera, and merge them into one giant image. For example, I might take three photos and arrange them in a vertical stack for output as a single image. Ideally, I'd like to be able to keep the images at the original size. Unfortunately, using Bitmap.cre...

Custom OverlayItem not drawing.

I created a custom OverlayItem class so that I could essentially have one kind of OverlayItem whose Drawable marker would set itself depending on the state of some data that I pass into it. I have attempted to accomplish this by, on my first attempt, utilizing the setMarker method within the OverlayItem class. Once that did not work I ...

Trouble padding

Hi, I have a horizontal LinearLayout. This LinearLayout has a checkbox next to another LinearLayout. The layout width/height of the checkbox is wrap_content, whereas the inner LinearLayout is fill_parent/wrap_content. The layout_weight of the inner LinearLayout is set to 1. I've tried to add some android:padding around the checkbox ...

Cannot import android.text.util.Regex? Where is it?

I'm developing an application and I want to use android.text.util.Regex.WEB_URL_PATTERN as the pattern for the Linkify. But, as I have notice, I cannot import android.text.util.Regex for some reason. Why so? Is there a way to workaround this? ...

Forcing android camera resolution

In my android app, I would like to be able to limit the maximal resolution (or size in mb) of a picture being taken. here is how i call the camera activity : Intent intent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE ); intent.putExtra( MediaStore.EXTRA_OUTPUT, Uri.fromFile( new File( mTmpFilePath ) ) ); intent.putExtra( "filename", ...

reload listView data

I have a source of data that changes from time to time. When it does I simply do: mylistView.setAdapter(...) which works fine and replaces the old data with the new ones. Thing is, I dunno if it is the right way to go. Is there any way to notify the view about the change in the data layer? Bear in mind I am not using a content provide...

Intent URI to go to Calendar App.

Hi, I would like to know if there is any URI or action to go to a calendar app loaded in the mobile. The question is similar to http://stackoverflow.com/questions/3116147/intent-uri-to-go-to-favorite-contacts ...

Flash Testing for Android Phones

Okay, I'm and unemployed student and i want to make a game for one of adobe's mobile game contest for android phones and flash 10.1 Well, although i have cs4, i dont have cs5, and dont have the money to upgrade or buy a test phone. So i was wondering is there still anyway to emulate testing on the android platform with flash 10.1 game...

Android init.rc import statement not working

I am trying to add a separate init file called init.Mine.rc that holds other services that I want to start myself. I am trying to import this from init.rc so that it will just run the stuff from init.Mine.rc but it doesn't seem to be doing anything. I am starting logcat from init.Mine.rc and its not even showing up when I do a ps. I k...

New to android development. Is there an equivalent to Windows Mobile's Datagrid.

I everyone. I'm very new to Android development and I want to develop an application that uses a local database. I want to show the results of queries in a DataGrid like object. The UI would be somewhat similar to this. http://i5.photobucket.com/albums/y163/marco2530/img1.jpg Is it possible to develop this kind of UI in Android? If so...

Messaging and email intents in Android?

I've searched Google for this, but have only found similar examples--not exactly what I need. I simply need to start messaging (SMS) and email intents from my app with their "to" fields already populated. So I need to send a number with the sms intent and an email address with the email intent. Any help would be appreciated. ...

How to get list of email addresses from Contacts for autocomplete field in Android ?

Ive read through the docs and searched on here, but Im not quite understanding how all the pieces fit together. Was wondering if anyone has a clear explanation of how to grab a single column of data from Contacts and have it populate an autocomplete box. ...

Detect if specified url is an image in Android?

How to detect quickly if a specified URL contains an image in Android? I have link of type http://foo.bar/w23afv so naive approach like checking end of URL string won't work here. ...

Should startActivity always run the started Activities onCreate?

I have a main activity and a sub activity. The main activity starts the sub activity using startActivity, and passes an object in the intent. The sub activity reads the object out of the intent in its onCreate action. The sub activity updates the object, then returns to the main activity using startActivity, again passing the updated obj...

How to select font size and stil being future compatible depending on screen density/size/size of images in Android.

I create a game board with squares. The size of each square (both height and width) is phone_pixel_width/number_of_squares to maximize the size of each square on the game screen depending on resolution (oh and I do not support mdpi devices, thus it does not get to small). Now my problem is that I also write text in these squares. If I u...

How to query an api in Android?

Hi, is it possible to query a website's api from an android app? If so, how to do you handle the return if it's in xml? Thanks ...