android

Why my dynamically created imageviews wont assign a click event

Hi, I have a for loop that dynamically creates imageviews and then i am assigning an onclicklistener to the imageviews, i have assigned these onclicklisteners but the event wont fire. why is this? Here is the code: Note: BlockState is extended by the ImageView Class. The location to where the ImageViews (BlockState) are created is in ...

Make TextView turn orange when focused?

Hi, I have a textview, I set it as clickable and focusable - how do I get it to highlight to orange (like a button) when the user focuses it with the trackwheel etc?: TextView tv = ...; tv.setClickable(true); tv.setFocusable(true); Thanks ...

Adding and getting data displayed

Hey smart guys, please help me! I dont understand what I need to add in to my code, that the "items" what I enter goes to database. If Im adding item into arraylist with buttonclick, how can I do so, that the item goes to database. And if I close the application, where is five items for example, and then open the application again and t...

Preferred Developer Android Phone for using the ZXing library

Using this library, ZXing, we have a project at school in which we'll implement a inventory system using Android phones. We aim to use an Android phone to be a inexpensive replacement to this: I've read some of the warnings on the FAQ for certain phones. Is there a specific phone that Android developers prefer (with use of the ZXing ...

Link error using Cygwin toolchain

Hi. I need to use Cygwin to compile C++ code for an Android project. I'm having trouble compiling even a basic "hello world" program. The console gives me this message: /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: unrecognized -a option `ware' I've googled the error and the only result I've found was an issue...

Avoiding highlight flash in Android

I have two drawables that are used as backgrounds to indicate state (pressed or selected) of my list items. The Pressed drawable is a selector, but with no state specified; it is wired up via XML to be the android:listSelector for the list. <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/a...

android instrumentation test case - getinstrumentation() returning null

basically the title says it all. I've been trying to make a test case extending intstrumentationtestcase, and whenever I call getinstrumentation() it returns a null instance of Instrumentation instead of an Instrumentation, rendering any of the automation I'm wanting to do useless. I have the permission set in the manifest as well even ...

Uniquely Identify an Android Handset

Is there a unique ID that is given to Android handests that is available through the SDK? I want to provide a web-service with actions that can only be performed once per resource per user. Maybe there is a different way to go about this. Any ideas? ...

How to log each application activity in android ??

Hello I want to log application activity information on my android phone, I just need 2 things, the start time of the application and the end time of the application. I just want to know for how much time a particular application/activity was running. Say for example a user launched music player and after some time closed it? I just w...

Choosing background for Live Wallpaper.

Hello all, I'm writing a live wallpaper that creates an effect over a background. I want the user to be able to choose the background from any of the system wallpapers and camera photos. What I would like is for the user to be able to press a button in the Settings menu, have the list of options show up just like setting the wallpaper...

How can I make asynchronous URL connections on Android?

I am using the following class to connect to my web service. I would like to make this asynchronous. How can I do this? package org.stocktwits.helper; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import org.apache.http.HttpEntity; import org.apache.http.HttpRe...

Images for AlertDialog buttons.

Is it possible to add drawables to the positive, negative and neutral buttons of an AlertDialog? If yes, then how? ...

Developing Android outside of the SDK

It seems as if every Android application I really want to make is impossible to make with the current SDK. It doesn't give me access to certain things I would like to work with. This is an example of one of these things. I know it is possible since I've seen apps in the market that do things that the SDK cannot do. My basic question ...

need help on tab change listener?

hi.. i have a tab activity in my main actitvity,from it first how can i override the ontabchange listener in another activity. view TabHost tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec("tab1").setContent( new Intent(this, Bru_Press_MostRecent.class)).setIndicator( prepareTabView("Insider Extr...

Why is AES/CTR/NoPadding broken?

To keep it simple I am using a hard coded key and IV for now. AesWriter (below) encrypts and writes the original plaintext, Abc\t1234\t\t\t\t\n, to a file as 11,87,-74,122,-127,48,-118,39,82,-83,68,-30,-84. But AesReader (also below) decrypts the contents of the file consistently as zW?D?4?rc?~???~?_=p?J. Any ideas where I am going wrong...

Android: Best practice for keeping data in Memory and Database at same time.

We're designing an Android app that has a lot of data ("customers", "products", "orders"...), and we don't want to query sqlite every time we need some record. We wanna avoid to query database as most as we can, so we decided to keep certain data allways in memory. Our initial idea is to create 2 simple classes: "MemoryRecord": a clas...

send message in a localService

Hi, I would like to know if it's okay to do the follwing in a localservice: public class theApp extends Application { public static Handler m_msgHandler; } public class mainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { theApp.m_msgHandler = m_msgHandler; :::: } pr...

Linkify custom location in textView?

I have a TextView with location data that I want to Linkify. When link will be clicked an Intent should be fired that will start Maps. How should I achieve this effect? UPDATE: I have something like "My street 9, My city". Now I want to have all this text to appear like a link and have intent fired with URI: geo:0,0?q=My+street+9,+My+c...

Catching MEDIA_BUTTON intent on pre-2.2 OS

Hi, I am trying to catch media key event from a headphones that have media controls. I registered a BroadcastReceiver for the MEDIA_BUTTON intent. This code generally works on devices that doesn't have the default android music player, I could catch all the MEDIA_BUTTON intents on my Sony X10. It doesn't work on my friend's HTC, it seems...

Rectangle shape drawable, specify top and bottom stroke colors?

Hi, Is there any way to define a top and bottom stroke for a gradient, or create a compound shape drawable?: // option1: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#f00" android:endColor="#0f0" /> <stroke top=1dip, yellow bottom...