android

Android Bluetooth - Can't connect out

I am developing an application which uses Bluetooth to connect to a device and send/receive data. I am doing all of my testing with a Nexus One phone. I have never been able to establish a SPP (serial port) connection from my phone to any device. However, I have been able to connect from a device (my laptop) to my phone using a Mac equi...

Looking into the Android source, specifically around activity & service lifecycle

I want to look more into the workings of Android. More specifically I want to know how Applications (including Activities and Services) get launched by the system. I also want to be able to see who calls their lifecycle methods and how objects get allocated and recycled. I have downloaded the Android source from git and browsed around f...

Android library: resources are merged, code is not

Hi all, I'm trying to set up an Android application with an Android library project dependence in Eclipse. I've set up a project called AnTest and a library project called AnLib. I've provided a reference to AnLib in the project properties of AnTest. Now I'm trying to refer to some library code (a static public method) from AnTest. Eclip...

Android SDK manager fails, if launched from Eclipse

Has anyone seen this problem? I'm in the middle of updating my SDK to add Android 2.2, on my Mac. You don't have to download the entire SDK -- there is a tool already on your system which can download just the extra parts of Adroid 2.2 This page explains: http://developer.android.com/sdk/adding-components.html The tool is called the ...

Andorid - Text dropdown/selection of Spinner does not show

Hi, I'm using this sample code to populate the Spinner. Data is read from database. The selection displays correctly - in this case, it shows "Green" and "Red". Spinner spinnerColor = (Spinner) findViewById(R.id.spinnertProfile); mProfileDbHelper = new ProfileDbAdapter(this); mProfileDbHelper.open(); Cursor profilesCu...

What context do I use for a new Dialog?

I need a custom dialog to appear on button press. Here is my code: Button button3 = (Button) findViewById(R.id.Button03); button3.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { final Dialog custdialog = new Dialog(this); custdialog.setContentView(R.layout.cust...

Starting an activity from a view in android?

Is there a way to start an activity from a view? I have this nice view that renders these menu buttons and when they click a particular button (Trapped in an onTouch event) I want to start the "clicked" activity. It seems that there from my view startActivity method is uncallable. So that leads me to believe that there is no way to do...

How to display selected Item in Spinner?

I created two Spinners to display the data in my application. In my first Spinner, the first item of the list is always displayed directly, but in the second Spinner nothing is displayed, even if I click on an item on the drop down view. Can anybody explain this behaviour? Here is the code of the initialisation of the two spinners: pro...

How to quickly integrate with multiple merchants from one app

Hi folks, I'm trying to write a free mobile app that would make payments merchant-agnostic for the customer. Context: Most web-apps are merchant centric and allow for multiple payment types from the customer. But the problem I'm trying to additionally solve is to have, say, a mobile app that is capable of paying as many merchants as p...

Eclipse Jar export script

I have a shared project that I'd like to split up in Eclipse. It's an android shared library which some packages should just be jar files others need to be smaller shared libraries. What is the best way to handle this other than manually creating smaller projects? Also is there a way to create a script to create exported jar files from...

No dx in android SDK?

I just downloaded android SDK for linux_x86. I cannot find dx though. Document says it should be on /tools/ . is dx not included any more from some point? ...

Android multiple column list/grid with adapter and OnItemClickListener?

I have a simple grid with rows of items and columns of options on each item. Of course I can manually link OnClick actions to cell items through specific resource IDs: views.setOnClickPendingIntent(R.id.row1column1, launchA); views.setOnClickPendingIntent(R.id.row1column2, launchB); // ... views.setOnClickPendingIntent(R.id.row2co...

How to create and apply styles through programming in android?

Hi Friends, I am new to Android app. development. I need to change the existing style at runtime or can create new styles at runtime and I need to apply it for my buttons and textviews.. Can any one suggest me? ...

Unexpected visual element in a simple Tab layout

The screen shot below is of a simplified version of the application from the Tab Layout tutorial. You can see a black horizontal line below the tabs. Why is it there and how can I remove it? ...

Android ==> Loggin witthout going to debug mode ???

Is there any way to log within the application without being in debug mode. When i am in debug mode the application runs tooo slow. Thanks ...

How should I decompress a large data file in AsyncTask.doInBackground?

Hi, I have a large data file, which is zipped, and approximately 20MB. When it's unzipped, it's up to about 50MB. The following source code works fine. I found the original on the web somewhere else and modified it a bit. And this method is called within the AsyncTask.doInBackground. So, what I want to know is, how can I save the on go...

Android - status bar prevents full screen

My app correctly runs in full screen when it's started. However after minimizing and then returning to the app, the status bar pops up and pushes my views down a little. How can I keep the status bar from moving my views? Here is my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/a...

Android getCacheDir in AsyncTask

Can I use getCacheDir() only in a class that extends Activity? I would like to use it in an AsyncTask so that I can do the time intensive cache file saving in it. Thanks Chris ...

choosing between requery or firing the query again in SQLite

hi Friends, i have been using a SQLite database, Theres a situation where i have a list which displays all the "name" field data of a table "table1". Now i have a button to insert data in "table1". The list is populated using a simple cursor adapter which is passed a cursor "cursor1" populated with the data. "cursor1" is prepared using ...

Why am I getting a SACSID cookie from google appengine login instead of an ACSID?

I've got an android app that authenticates to an appengine app. I've had it working for a little while, until the authToken supplied to me (by android's AccountManager) expired, causing a 500 error when I tried to use it to get a session cookie. I have now invalidated the authToken, but after that I still cannot authenticate. However, i...