[android-developers] Re: how to update apk's Jad file in run time

2009-01-05 Thread Jean-Baptiste Queru

Besides knowing whether you can safely edit classes.dex (I'd recommend
putting the relevant information in a separate file in the apk),
you're not going to be able to do what you have in mind without also
re-signing the apk.

JBQ

On 1/5/09, sudha sudhagupta2...@gmail.com wrote:

 can i make changes in classes.dex file like..can I replace any string
 in classes.dex file with some other string(which is of the same
 length) and rezip the file.
 will this work for .apk on android??

 Plz Help me Its urgent

 Thanks
 Sudha Gupta

 On Dec 5 2008, 5:39 pm, Dianne Hackborn hack...@android.com wrote:
 An .apk is read-only, you can't modify it.

 On Thu, Dec 4, 2008 at 11:19 PM, Sudha Gupta
 sudhagupta2...@gmail.comwrote:



  Hello,
   I have a application in J2me, its a client server application. In this
  application user registers the handset(with the phone number) on the web
  site , In return server sends a message to the handset with the link to
  download the client application on the handset.
  before download of the client application, server appends few
  values(like
  device id, user id) in the jad file.
   I am developing the same application for Android, I wanted to know how
  this information (device id, user id) will be added in the apk in run
  time.

  Plz help me

  Thanks
  Sudha gupta

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.
 



-- 
Jean-Baptiste M. JBQ Queru
Android Engineer, Google.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] onListItemClick won't fire.

2009-01-05 Thread chrispix

This is what I am trying to accomplish.
- Display List from Database w/ a delete button.
- Launch a new activity based on the row selected - I am just going to
pass data on.

I have an activity that displays a list view from a database, I also
have a 3 imagebuttons thrown in there (static images) - one should
probably be just an image. Anyhow, The first image should delete the
record, and the other two should probably be images.  My listactivity
launches fine, shows all the data in the database. But no matter what
you click on, it does nothing. I have setup an @override of
onListItemClick so I can find the record in the database to either
delete / launch new activity.

Maybe I am going around this the wrong way, but I am stuck on the
onListItemClick.
Here is all the code :

---
FindList.java
---
package com.froogloid.android.gspot;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.content.Intent;
import android.database.Cursor;
import android.app.ListActivity;


public class FindList extends ListActivity
{
private DBHelper mDbHelper;
public SimpleCursorAdapter notes;
public int[] to;
public ListView findlistview;

 @Override
   public void onCreate(Bundle savedInstanceState)
   {
 super.onCreate(savedInstanceState);
 // Set view as list view container.
setContentView(R.layout.findlist);
 // get Database information (using DBHelper)
mDbHelper = new DBHelper(this);
mDbHelper.open();

 // Get data and fill it into a List
fillData();
   }

 private void fillData() {

// Get all of the notes from the database and create the
cursor
Cursor c = mDbHelper.fetchAllLocations();
startManagingCursor(c);

// Map values from db to string array
String[] from = new String[] { DBHelper.KEY_BUSINESSNAME,
DBHelper.KEY_ADDRESS, DBHelper.KEY_CITY, DBHelper.KEY_GPSLONG,
DBHelper.KEY_GPSLAT, DBHelper.KEY_IMAGEFILENAME + };

// create array of values of widgits
to = new int[] { R.id.businessname, R.id.address, R.id.city,
R.id.gpslong, R.id.gpslat, R.id.imagefilename, };

// Now create an array adapter and set it to display using
our row from notes_row.xml
 notes =
new SimpleCursorAdapter(this, R.layout.notes_row, c,
from, to);
setListAdapter(notes);


}





// 

   //
// onListItemClick is not being triggered  //
// while debugging - any way to montior  //
// android system for all system events?//
// 

 //

@Override
protected void onListItemClick(ListView l, View v, int position, long
id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);

// set up an intent that launces the Find.class from Find.java
Intent i = new Intent(this,Find.class);

// use the position to set a cursor of that position
Cursor c = (Cursor) notes.getItem(position);

// get the values from the list and pass onto activity. of the 
ROWID
long positionID = 
c.getLong(c.getColumnIndex(DBHelper.KEY_ROWID));

// put a value into the intent
i.putExtra(com.froogloid.android.gspot.Find.positionID,
positionID);

// Start intent
startActivity(i);



}


}


FindList.xml

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android android:layout_width=wrap_content
android:layout_height=wrap_content
  ListView android:id=@id/android:list
android:layout_width=wrap_content
android:layout_height=wrap_content android:clickable=true/
  TextView android:id=@id/android:empty
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=@string/no_notes /
  /LinearLayout

---
notes_row.xml

[android-developers] Re: File permissions for world read/write

2009-01-05 Thread Jean-Baptiste Queru

Note that you shouldn't hard-code the path to the SD card. There's an
API in the Context class (if I remember correctly) that let's you
query it.

JBQ

On 1/4/09, ggcespia g...@boopsie.com wrote:

 problem solved.  package B had a typo in the file name.  works fine
 now.

 On Jan 3, 9:02 pm, ggcespia g...@boopsie.com wrote:
 I'm trying to create file at /sdcard/foobar.tmp from one package that
 needs to be readable by another package.  This works fine on the
 emulator. However, on the G1, if I create the file in package A, then
 try to read it in package B, the request fails - even tho both
 packages are signed by the same certificate.  I create the file from
 Package A with:

 File myFile = new File(/sdcard/foobar.tmp);
 myFile.createNewFile();

 FileOutputStream fOut =  new FileOutputStream(myFile);
 String sMofi = some text;
 fOut.write(sMofi.getBytes());
 fOut.flush();
 fOut.close();

 To see if the file exists from Package B, I use:
File myFile = new File(/sdcard/foobar.tmp);
 if (myFile.isFile())
 {
 bTempFile = true;
 }

 myFile.isFile() - returns false - I can see the file using ddms with
 permissions: rw-rw-

 Why does isFile fail?  I cannot use Context.openFileOutput() because
 that creates a file relative to package A - and B doesn't know where
 package A is...

 Is there a way to create a file at /sdcard/foobar.tmp and have any
 package be able to read or write it?
 



-- 
Jean-Baptiste M. JBQ Queru
Android Engineer, Google.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How To Custom Horizontal Scroll?

2009-01-05 Thread roland

Hi, you can implements OnGestureListener and override onScroll method,
you can get scroll distance with this method. This link has an example
i used to create a horizontal scrolling ListView.

http://nan-technicalblog.blogspot.com/2008/12/android-how-to-use-horizontal-scrolling.html

On 5 jan, 01:39, Moto medicalsou...@gmail.com wrote:
 I've read all over and everyone one asks how to achieve a horizontal
 scrolling on a LinearLayout.  It's really bad that no one has a
 solution to this issue...

 My question is;

 1. How do you use Scroller class? do I have to extend the class?
 2. How could I track finger location movement on a layout?

 A little hard coded Horizontal moving of a Layout.

 Move Item Horizontally:
 LinearLayout tbl = (LinearLayout)findViewById( R.id.MenuBarLayout );
 tbl.scrollTo(40, 0);

 Hopefully someone can point me to the right direction...

 Thanks,
 Moto!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Orientation within orientation

2009-01-05 Thread Sundog

Hello,

How can I have a main layout with a vertical orientation and have
some text appear within it in a horizontal orientation?

Even though my app is used horizontally, I use a vertical layout to
get the title bar out of the way and get maximum vertical screen real
estate. But I need the ability to display a TextView that is rotated
90 degrees so as to appear normal in a horizontal layout. Can this be
done, short of using an animation?

Thanks in advance for any assistance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Stopping a Thread

2009-01-05 Thread Cyril Jaquier

Hi Brad,

 Can anyone tell me how to safely stop a thread?
 

You can't stop a thread but you can let it die. Just return from the 
Thread#run method. Most of the time you will have something like:

public volatile boolean shutdownRequested = false;

public void run() {
   while (!shutdownRequested) {
 // ... do something ...
   }
}

Just set the shutdownRequested variable to true to quit the loop and 
stop the thread.

Regards,

Cyril

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: XMLHttpRequest in WebView

2009-01-05 Thread Fred Grott(shareme)

That might not be correct

On Jan 5, 9:22 am, mboehmer 4...@phoku.de wrote:
 Hello,

 I have read that the XMLHttpRequest object is not available in a
 WebView? Is this misunderstanding or true? If so, are there any
 workarounds for AJAX-based applications?

 Best regards
 mboehmer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Get the screen resolution

2009-01-05 Thread Michal

First you need to get the WindowManager by :

WindowManager wm = getSystemService(Context.WINDOW_SERVICE);

Next use the method to retrieve a Display object:

Display d = wm.getDefaultDisplay();

... and finally the resolution:

int height = d.getHeight();
int width = d.getWidth();

Hope that helps.

On 5 Sty, 15:17, Nico nicolas.d...@gmail.com wrote:
 Hi,
 I need to get the screen resolution, how can I get it ?
 Thx.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Screenshot, screen capture

2009-01-05 Thread tryout

Hello,

I see that in android.Manifest.permission file there is
READ_FRAME_BUFFER permission that Allows an application to take
screen shots and more generally get access to the frame buffer data 

Unfortunately there is no additionall information how to use this
feature.

I would like to know how to create an application (with a Service)
that will take screenshots of an actual view.

Moreover, when I declare this permission in my AndroidManifest.xml I
get Not granting permission warning while launching it on the
emulator.

Thanks fo any help,
Michal

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with screenshot

2009-01-05 Thread Michal

I'm also looking for a response on this question.

Moreover, is it possible to get the root view from a Service
I mean, the Service runs in the background and I would like to capture
the actual displaying screen

Thanks for help,
Michal


On 17 Gru 2008, 09:40, Dec. 030440...@163.com wrote:
   hi,guys~!
   i've been playing around on g-phone test for a few days,But i'm
 really confused on how to get currentscreenshot,One way is to use
 getrootview()-getdrawingcache() method,providing that a View on the
 screen is already known ;But the statusbar is lost,What's more,if i
 launch an activity from an instrumentation class,i just couldn't get
 any View presently shown on the screen,so i tryed to make it the
 following way,but it also makes no sense:
 first new a View based on the target context:
   View v=new View(this.getTargetContext());
 Then i tryed the focussearch() method and several others provided in
 the SDK,but i got nothing but the nonepointer exception,真TM郁闷。。

 So, Any idears ??
 Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Implementing Parcelable with Eclipse - MyClass.java is in the way of MyClass.aidl

2009-01-05 Thread Jonathan DERROUGH

Hi,

I am trying to use the Parcelable interface to have an activity
communicate with a service.


Following the AIDL tutorial (http://code.google.com/intl/fr/android/
reference/aidl.html), I implemented the Parcelable interface in
MyClass.java and created the corresponding .aidl file (MyClass.aidl)
containing only:

parcelable MyClass;


Since then, I get this error message from Eclipse (with the typo):

MyClass.java is in the way of MyClass.aidl, remove it or rename of one
the files.


I don't get it, it seems that aidl trys to convert MyClass.aidl as it
would do with a service interface although the comments in the
Rect.aidl file say:

// Declare Rect so AIDL can find it and knows that it implements
// the parcelable protocol.
parcelable Rect;


Am I missing something?
Please help!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: T-Mobile G1: How to properly resume View's focus when Activity resumed from screen black-out?

2009-01-05 Thread shaunke...@gmail.com

Try keepScreenOn:

http://code.google.com/android/reference/android/view/View.html#attr_android:keepScreenOn

On Dec 31 2008, 12:58 pm, Toothy Bunny hongkun...@gmail.com wrote:
 Hi All,
 If the G1 is idle for short period (no user input) while a Activity is
 still running, the screen blacks out and the user input is locked.
 When the screen is unlocked by the user again and screen light up, we
 found the View object does not have input focus, as the result, the
 application does not react any user input.

 To solve this App. frozen problem, I added View.request() in
 Activity's onResume() method becase onResume() is called when the
 Activity comes back after screen black-out.

 Also, is there a way to completely avoid screen black-out, in other
 words, how can we make the screen always on when a Activity is running
 even there is no user input.

 Thanks for any suggestions!
 Hongkunwww.omnigsoft.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] XML Schemas for Android namespaces?

2009-01-05 Thread Erik Hellman

Hi!

I search for the XML schema defined by the namespace http://
schemas.android.com/apk/res/android. I know this has been asked
before, but that was over a year ago. Are this schema available
somewhere? It would be really great if these could be published as it
would make XML editing MUCH easier for those of us  who prefer
NetBeans or IntelliJ.

Any progress on publishing these? If not, is there any other
specification available so that we (the community) could create the
schemas outselves?

Thanks!

// Erik

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] HashMap via http tunneling

2009-01-05 Thread MarkMarkus

Hi,

how can i connect an Android application
to a servlet engine (es. tomcat) by sending
an HashMap  via http tunneling?

In my Android application I tried to
send/receivce a HashMap by
using the java.net.URLConnection but, as
descrived in the documentation, the
method getOutputStream() returns UnknownServiceException.

Is there an alternative solution?

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread shaunke...@gmail.com

Are you using a class that extends SQLiteOpenHelper to open your DB.
You should be able to specify a version number then override the
onUpgrade method in your SQLiteOpenHelper to update your db from
earlier versions.

See:
http://code.google.com/android/reference/android/database/sqlite/SQLiteOpenHelper.html
and look at the NotePad tutorial.


On Jan 4, 6:45 pm, Jay-andro jayan...@gmail.com wrote:
 I have an app that creates an sqllite database on first-use, if one
 doesn't already exist. Recently I released a new version of the app,
 and all of a sudden several users are complaining of erros that I
 didnt encounter in my testing. In my development I always installed
 using adb over usb, which in turn requires uninstall the older version
 first. So the database was always created anew on first-use of the new
 version. But I suspect my existing users are doing an in-place install
 on top of their old version, in which case the old db is incompatible
 with the new one.

 So my questions are:
 - Does the Market app allow you to install a new version on top of
 an old one, without requiring an uninstall first (unlike adb)?
 - If an in-place upgrade is supported but the database is not dropped,
 the question arises what else is not deleted? Resources, preferences,
 manifest? I suspect there would be major havoc if these things werent
 completely removed  replaced by the new version.

 I am now contemplating adding a preference which will indicate to the
 app what version of my db it needs and use this on first-use to
 determine if I need to drop and recreate the database or just use the
 old db.

 Any thoughts?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: XMPP through Smack

2009-01-05 Thread Add

I tried that update. it works with gtalk, but when I tried with my own
ejabberd server, it didn't work. the error was host-unknown.

Could anyone suggest me?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Animations Persistance

2009-01-05 Thread Ryan

Hi,

I am looking for a way for animations to persist in my application.
For example, if I user clicks one button I want to run a scale
animation on a view, to scale the view 200%. Then if a user clicks
another button I may want to run a tanslate animation to slide the
view 50px's to the left.

I can set up both of these animations to run in isolation, and to
persist afterwards by setting fillAfter to true. But each time a
button is pressed the view goes back to it's original position and
scale, before the animation is run. E.G. I cannot get my scaled view
to move 50px's o the left. It always reverts to an unscaled view, and
then slides this left.

Any advice, to get the transformations to persist for the lifetime of
the views would be much appreciated.

Thanks,

Ryan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] file system change notification

2009-01-05 Thread pradeep

how to get notifications if i make any change in file system like i
add a file or delete a file.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Windows Live Messenger and other services not appearing in the IM Client?

2009-01-05 Thread Untouchable

Hi!

I just recieved the Android Development Phone 1 (The G1). However, the
IM client only shows Gmail and not the others.. Is there a way to get
them, as I would like to see how the IM client handles it

Kind Regards

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Working with JPEG images

2009-01-05 Thread nickthecook

Hello all,

I'm looking for a way to work with JPEG images read from a file in
Android. Specifically, I would like to scale them, and be able to get
their height and width.

I can get an InputStream to a JPEG file on the SD card, and I can work
with the raw bytes, but I'd like something a little more high-level.

Bitmap seems to be able to encode JPEGs, but not decode them.

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ddms error: Cannot connect to adb

2009-01-05 Thread panku

Dear All

I am trying to run HelloAndroid application after configuring the
steps mentioned in the Getting Started guide.

But when i am open eclipse  run application, i am getting the
following error:

-ddms fail to initialize monitor thread: Unable to establish loopback
connection

Can you please help me to solve this problem.

Regards,
Pankaj

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Error in native method Picture.nativeCreateFromStream()

2009-01-05 Thread nickthecook

Hello all,

I'm having some trouble creating a Picture from an InputStream. I am
trying to do this:

ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
Picture pic = Picture.createFromStream(bis);

The problem also occurs when I try to use an InputStream returned by
ContentResolver.openInputStream(Uri):

InputStream is = getContentResolver.openInputStream(mUri);
Picture pic = Picture.createFromStream(is);

Picture.createFromStream(InputStream) invokes the native method
Picture.nativeCreateFromStream(InputStream, byte[]), and this is where
the trail goes cold for me:

public static Picture createFromStream(InputStream stream) {
return new Picture(
nativeCreateFromStream(stream, new byte
[WORKING_STREAM_STORAGE]));
}

I have been loading images from this Uri (content://media/external/
images/media/152) successfully for a while. I open an InputStream,
read all the bytes, close the input stream, and there is no problem.
However, when I try to use either the InputStream returned by
ContentResolver.openInputStream(Uri), or I read all the bytes out of
that and wrap them in a ByteArrayInputStream, Picture.createFromStream
(InputStream) fails with the stack trace below.

Has anyone successfully used Picture.createFromStream(InputStream)?

=== Stack Trace 
I/dalvikvm-heap( 4776): Grow heap (frag case) to 5.940MB for 316-
byte allocation
D/dalvikvm( 4776): GC freed 371 objects / 20736 bytes in 89ms
I/Image   ( 4776): Read 345682 bytes for 
content://media/external/images/media/152.
I/DEBUG   (   29): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (   29): Build fingerprint: 'android-devphone1/
dream_devphone/dream/trout:1.0/UNLOCKED/116222:userdebug/test-keys'
I/DEBUG   (   29): pid: 4776, tid: 4776   org.hopto.group18.postbot

I/DEBUG   (   29): signal 6 (SIGABRT), fault addr 12a8
I/DEBUG   (   29):  r0   r1 0006  r2   r3 0080
I/DEBUG   (   29):  r4 2eb0  r5 40008000  r6   r7 0025
I/DEBUG   (   29):  r8 beb0a630  r9 4104d9c8  10 4104d9b8  fp 
I/DEBUG   (   29):  ip   sp beb0a5c8  lr afe0ef37  pc
afe0d1fc  cpsr 0010
I/DEBUG   (   29):  #00  pc afe0d1fc  /system/lib/libc.so
I/DEBUG   (   29):  #01  pc afe0ef34  /system/lib/libc.so
I/DEBUG   (   29):  #02  pc ace08540  /system/lib/libcorecg.so
I/DEBUG   (   29):  #03  pc ac075cec  /system/lib/libsgl.so
I/DEBUG   (   29):  #04  pc ad3413da  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):  #05  pc ad00d9f4  /system/lib/libdvm.so
I/DEBUG   (   29):  #06  pc ad04120e  /system/lib/libdvm.so
I/DEBUG   (   29):  #07  pc ad012748  /system/lib/libdvm.so
I/DEBUG   (   29):  #08  pc ad02a92c  /system/lib/libdvm.so
I/DEBUG   (   29):  #09  pc ad0169d0  /system/lib/libdvm.so
I/DEBUG   (   29):  #10  pc ad052096  /system/lib/libdvm.so
I/DEBUG   (   29):  #11  pc ad03ccbc  /system/lib/libdvm.so
I/DEBUG   (   29):  #12  pc ad012748  /system/lib/libdvm.so
I/DEBUG   (   29):  #13  pc ad02a92c  /system/lib/libdvm.so
I/DEBUG   (   29):  #14  pc ad0169d0  /system/lib/libdvm.so
I/DEBUG   (   29):  #15  pc ad051f10  /system/lib/libdvm.so
I/DEBUG   (   29):  #16  pc ad03f87a  /system/lib/libdvm.so
I/DEBUG   (   29):  #17  pc ad3282b4  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):  #18  pc ad328d40  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):  #19  pc 8c12  /system/bin/app_process
I/DEBUG   (   29):  #20  pc afe1dbd2  /system/lib/libc.so
I/DEBUG   (   29):  #21  pc afe0b010  /system/lib/libc.so
I/DEBUG   (   29):  #22  pc bd70  /system/bin/linker
I/DEBUG   (   29): stack:
I/DEBUG   (   29): beb0a588  beb0a630  [stack]
I/DEBUG   (   29): beb0a58c  afe35f3c
I/DEBUG   (   29): beb0a590  0084
I/DEBUG   (   29): beb0a594  0001
I/DEBUG   (   29): beb0a598  afe35f3c
I/DEBUG   (   29): beb0a59c  000c
I/DEBUG   (   29): beb0a5a0  afe35f3c
I/DEBUG   (   29): beb0a5a4  afe12dbd  /system/lib/libc.so
I/DEBUG   (   29): beb0a5a8  afe35f3c
I/DEBUG   (   29): beb0a5ac  afe35f90
I/DEBUG   (   29): beb0a5b0  
I/DEBUG   (   29): beb0a5b4  afe1238d  /system/lib/libc.so
I/DEBUG   (   29): beb0a5b8  ace0acc0  /system/lib/libcorecg.so
I/DEBUG   (   29): beb0a5bc  afe11539  /system/lib/libc.so
I/DEBUG   (   29): beb0a5c0  df002777
I/DEBUG   (   29): beb0a5c4  e3a070ad
I/DEBUG   (   29): #00 beb0a5c8  2eb0
I/DEBUG   (   29): beb0a5cc  40008000
I/DEBUG   (   29): beb0a5d0  
I/DEBUG   (   29): beb0a5d4  4104d9d0
I/DEBUG   (   29): beb0a5d8  
I/DEBUG   (   29): beb0a5dc  afe0ef37  /system/lib/libc.so
I/DEBUG   (   29): #01 beb0a5e0  0004
I/DEBUG   (   29): beb0a5e4  0001
I/DEBUG   (   29): 

[android-developers] Defining Themes in Android

2009-01-05 Thread ff

Hi!

I'm trying to study Themes and found the following poor piece of code:

style name=ThemeNew
   item name=windowFrame@drawable/screen_frame/item
   item name=windowBackground@drawable/screen_background_white/
item
   item name=panelForegroundColor#FF00/item
   item name=panelBackgroundColor#/item
   item name=panelTextColor?panelForegroundColor/item
   item name=panelTextSize14/item
   item name=menuItemTextColor?panelTextColor/item
   item name=menuItemTextSize?panelTextSize/item
/style

This is all about defining custom themes!!
what item names can I use? where is the list and description of them?

Thank you!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Emulator crashing

2009-01-05 Thread Vitaly

Hello,

I'm just starting with Java, Eclipse and Android, so maybe no wonder I
ran into the following problem:
when I run an application from Eclipse, emulator starts, my simple app
shows up, etc. But when I close the emulator, I get a Windows'
standard error message Emulator.exe has stopped working and will be
closed and another error message in the Eclipse's console window:
[2009-01-04 12:23:06 - DeviceMonitor]Error reading jdwp list: EOF
[2009-01-04 12:23:06 - DeviceMonitor]Connection Failure when starting
to monitor device 'emulator-5554' : device (emulator-5554) request
rejected: device not found

I'd appreciate if someone could tell me what I'm doing wrong and how
can I terminate the emulator correctly.

Thanks,
Vitaly

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with screenshot

2009-01-05 Thread tymczasow...@gmail.com

I would like also to know a response to that question.

Moreover, is it possible for a Service to get a root view from a view
hierarchy?

Michal

On 17 Gru 2008, 09:40, Dec. 030440...@163.com wrote:
   hi,guys~!
   i've been playing around on g-phone test for a few days,But i'm
 really confused on how to get currentscreenshot,One way is to use
 getrootview()-getdrawingcache() method,providing that a View on the
 screen is already known ;But the statusbar is lost,What's more,if i
 launch an activity from an instrumentation class,i just couldn't get
 any View presently shown on the screen,so i tryed to make it the
 following way,but it also makes no sense:
 first new a View based on the target context:
   View v=new View(this.getTargetContext());
 Then i tryed the focussearch() method and several others provided in
 the SDK,but i got nothing but the nonepointer exception,真TM郁闷。。

 So, Any idears ??
 Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: My GL10 always get Error.. how?

2009-01-05 Thread wyjday

I think on emulator, we should not have GPU support. is it works fine
on G1 phone. I am not sure if G1 phone has GPU support or not!

BRs
wyjday
2009/01/05

On Nov 18 2008, 11:21 pm, Hydrian hyt...@gmail.com wrote:
 I'm trying to make an opengl program.

 my program starts from SpriteText(sample program)

 but even call glDisable.. or glClear

 I can get glError...

 I'm trying may kinds of.. configspec
         int[] configSpec = {
 //                      EGL10.EGL_RED_SIZE, 4,
 //                      EGL10.EGL_GREEN_SIZE, 4,
 //                      EGL10.EGL_BLUE_SIZE, 4,
 //                      EGL10.EGL_ALPHA_SIZE, EGL10.EGL_DONT_CARE,
 //                      EGL10.EGL_BUFFER_SIZE, 4,
 //                EGL10.EGL_DEPTH_SIZE, 4,
                 EGL10.EGL_NONE
         };

 like these
 but always same..

 and when i start my program,
 I can see some error logs on ddms

 11-18 15:19:42.544: ERROR/GLLogger(205): couldn't load libhgl.so
 library (Cannot find library)
 11-18 15:19:42.654: DEBUG/SurfaceFlinger(53): pid 205 requesting gpu
 surface (current owner = -1)
 11-18 15:19:42.654: ERROR/MemoryHeapBase(53): error opening /dev/
 pmem_gpu1: No such file or directory
 11-18 15:19:42.654: ERROR/MemoryHeapBase(53): error opening /dev/
 pmem_gpu0: No such file or directory
 11-18 15:19:42.664: DEBUG/SurfaceFlinger(53): pid 205 requesting gpu
 surface (current owner = -2)
 11-18 15:19:42.664: ERROR/MemoryHeapBase(53): error opening /dev/
 pmem_gpu1: No such file or directory
 11-18 15:19:42.664: ERROR/MemoryHeapBase(53): error opening /dev/
 pmem_gpu0: No such file or directory

 i'm very confused.. so I don't know how to solve this problem..

 if you have any idea please tell me

 ps sorry,Im poor at English..

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Checkin service realization

2009-01-05 Thread shentong

Hi,all:

Does anyone know android how to realize the checkin service next step?
Now, android only have a FallbackCheckinService.cpp, it is a empty
structure, not include actual checkin realization.

-- 
Best Regards,
shentong


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Question about cupcake changes.

2009-01-05 Thread Kent

I asked this on the discuss forum also.

The cupcake roadmap indicates: A number of settings in
android.provider.Settings.System were moved to
android.provider.Settings.Secure. Only system software can modify
these settings.

Is there any word on which settings will no be longer accessible to
public developers?

And a related question: will this change cripple settings management
applications already posted on the Market?

Thanks,
Kent

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] getLastKnownLocation is not working.

2009-01-05 Thread Amit Samel

Hello guys,
i am very much new to android platform. i am trying to implement some
codes from Android: A Programmer’s Guide. i have installed latest sdk
thats why there are  some issues regarding deprecated apis. when i was
trying to call getCurrentLocation() i got error , that this method is
not supported by LocationManager.So i had replaced it by
getLastKnownLocation . but it got crashed. can any one knows why is
this happening?
this is my code.
LocationManager myManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
Double latPoint = myManager.getLastKnownLocation(gps).getLatitude
();
Double lngPoint = myManager.getLastKnownLocation(gps).getLongitude
();
thanks .

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] G1 always off-line!

2009-01-05 Thread if

Hi,

I am desperately trying to connect to my G1, using Ubuntu 8.10, but
both adb and eclipse always see the device as off-line...please
help...

Thanks,

if

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Commercial applications policy

2009-01-05 Thread Bobby Kolev

Is there any light on to how are commercial applications going to be
distributed?

Like will they have to be fully functional and if so then are they
going to be protected by some type of DRM so that they can't be moved
from one device to another?

We have an application which takes add-ons from within the application
and charges for them.

How would such a model work under the Android's commercial
distribution model? Will we have to dispatch users to a place outside
the application to add a module? That defeats the whole ease-of-use
concept.

If that is not the right forum for those types of questions please
accept my apology and redirect me to a better one.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Emulator crashing

2009-01-05 Thread David Turner
this should not happen. you're probably encountering a weird emulator bug.
the Eclipse message is normal in case of an emulator crash.

what exact platform/OS do you have ? can you repeat this consistently, or
are the crashes random ?

thanks in advance

On Sun, Jan 4, 2009 at 11:16 AM, Vitaly vita...@gmail.com wrote:


 Hello,

 I'm just starting with Java, Eclipse and Android, so maybe no wonder I
 ran into the following problem:
 when I run an application from Eclipse, emulator starts, my simple app
 shows up, etc. But when I close the emulator, I get a Windows'
 standard error message Emulator.exe has stopped working and will be
 closed and another error message in the Eclipse's console window:
 [2009-01-04 12:23:06 - DeviceMonitor]Error reading jdwp list: EOF
 [2009-01-04 12:23:06 - DeviceMonitor]Connection Failure when starting
 to monitor device 'emulator-5554' : device (emulator-5554) request
 rejected: device not found

 I'd appreciate if someone could tell me what I'm doing wrong and how
 can I terminate the emulator correctly.

 Thanks,
 Vitaly

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Emulator crashing

2009-01-05 Thread Sundog

I always get this too. I don't think it interferes with normal
operation.

On Jan 4, 3:16 am, Vitaly vita...@gmail.com wrote:
 Hello,

 I'm just starting with Java, Eclipse and Android, so maybe no wonder I
 ran into the following problem:
 when I run an application from Eclipse, emulator starts, my simple app
 shows up, etc. But when I close the emulator, I get a Windows'
 standard error message Emulator.exe has stopped working and will be
 closed and another error message in the Eclipse's console window:
 [2009-01-04 12:23:06 - DeviceMonitor]Error reading jdwp list: EOF
 [2009-01-04 12:23:06 - DeviceMonitor]Connection Failure when starting
 to monitor device 'emulator-5554' : device (emulator-5554) request
 rejected: device not found

 I'd appreciate if someone could tell me what I'm doing wrong and how
 can I terminate the emulator correctly.

 Thanks,
 Vitaly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Emulator crashing

2009-01-05 Thread David Turner
On Mon, Jan 5, 2009 at 6:23 PM, Sundog michael_...@tmail.com wrote:


 I always get this too. I don't think it interferes with normal
 operation.



thanks for pointing this out. Can you answer the same basic questions ?



 On Jan 4, 3:16 am, Vitaly vita...@gmail.com wrote:
  Hello,
 
  I'm just starting with Java, Eclipse and Android, so maybe no wonder I
  ran into the following problem:
  when I run an application from Eclipse, emulator starts, my simple app
  shows up, etc. But when I close the emulator, I get a Windows'
  standard error message Emulator.exe has stopped working and will be
  closed and another error message in the Eclipse's console window:
  [2009-01-04 12:23:06 - DeviceMonitor]Error reading jdwp list: EOF
  [2009-01-04 12:23:06 - DeviceMonitor]Connection Failure when starting
  to monitor device 'emulator-5554' : device (emulator-5554) request
  rejected: device not found
 
  I'd appreciate if someone could tell me what I'm doing wrong and how
  can I terminate the emulator correctly.
 
  Thanks,
  Vitaly
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Stopping a Thread

2009-01-05 Thread Brad Gies
Can anyone tell me how to safely stop a thread? 

 

It seems that all the methods I can see to use are deprecated :-).

 

Thanks.

 

 

Sincerely,

 

Brad Gies

 

 

-

Brad Gies

27415 Greenfield Rd, # 2,

Southfield, MI, USA

48076

-

 

Moderation in everything, including abstinence

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Remapping Key Functions

2009-01-05 Thread Mark Murphy

Raghu D K wrote:
 Hello All,
 
 How do I map the keys to perform specific functions depending on the
 application ?
 For example:
 
 Key 108 DPOD_UP  // For scrolling up in a Browser application
 Key 108 VOLUME_UP // For Volume increase in the a Multimetia application

Implement onKeyDown() or similar methods in your activities.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Dev Phone - Failed to upload app using Eclipse (timeout)

2009-01-05 Thread Rafael Fernandes

hi guys,
any takers on this one? I was debugging the eclipse plug in and
everything, but no lucky...
the funny part is that it can connect to the device, but it can't
upload anything...

cheers,
rafa

On Dec 23 2008, 8:59 pm, Rafael Fernandes luizraf...@gmail.com
wrote:
 well, I'm actually using Eclipse as I did on the emulator...
 and this is how I wanna use once I also want to debug on the real
 device...

 Rafael Fernandes

 On Dec 23, 4:55 pm, Michael michael573...@gmail.com wrote:

  Yes, this is expected behavior, it's to prevent one application from
  accessing the data of another.

  But this does not get in the way of using adb to install/remove
  applications.  You are using adb install and adb uninstall yes?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] XMLHttpRequest in WebView

2009-01-05 Thread mboehmer

Hello,

I have read that the XMLHttpRequest object is not available in a
WebView? Is this misunderstanding or true? If so, are there any
workarounds for AJAX-based applications?

Best regards
mboehmer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Working with JPEG images

2009-01-05 Thread Mike Reed

BitmapFactory.decodeStream(...)

On Sun, Jan 4, 2009 at 11:55 AM, nickthecook nickthec...@gmail.com wrote:

 Hello all,

 I'm looking for a way to work with JPEG images read from a file in
 Android. Specifically, I would like to scale them, and be able to get
 their height and width.

 I can get an InputStream to a JPEG file on the SD card, and I can work
 with the raw bytes, but I'd like something a little more high-level.

 Bitmap seems to be able to encode JPEGs, but not decode them.

 Thanks!

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Reporting Exceptions

2009-01-05 Thread Mark Murphy

kelvin wrote:
 Is there a built-in or easy scheme to have users report exceptions to
 a developer?  I understand that you could try to get users to hook up
 a USB cable and run 'adb', but I don't think that's realistic.
 
 I'm running into a crash that appears to occur on a very small number
 of handsets, possibly while accessing the SD card, and trying to track
 this down remotely is driving me nuts.  Thanks in advance.

Built-in? No.

Easy? Depends on how you define it.

First, you need to catch the exception, if you aren't doing so already.

Next, you need to send the exception data to you. Some possibilities:

-- Write some simple Web service and use one of the HTTP APIs

-- Send an email through the user's email application (e.g.,
http://androidguys.com/?p=3100)

-- Nab some third-party JAR and send the data using some other transport
(e.g., email without user intervention, XMPP)

-- Send an SMS

You could try integrating something like log4j that already handles
these sorts of error deliveries, but I worry about too many dependencies
that you may have difficulty resolving.

If the OpenIntents team doesn't already have one, a common component for
doing this sort of error reporting would definitely be a slick addition
to Android developers' arsenals.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to force screen backlight brightness change immediately?

2009-01-05 Thread monmonja

I've done this using IHardwareService,  you guys may refer to this
link
http://almondmendoza.com/2009/01/05/changing-the-screen-brightness-programatically/

Hope it helps

Almond
http://almondmendoza.com

On Dec 27 2008, 2:16 am, Daniel velaz...@gmail.com wrote:
 I'm also looking for a solution for 
 thishttp://groups.google.com/group/android-developers/browse_thread/threa...

 thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Any updates on paid apps timeline?

2009-01-05 Thread loty

First problem is not a problem really. If app requires a camera then
no one in his own mind will install it on a device with no camera.
Second problem with multiple resolution will be a fact of life as
other Android devices hit the market. Luckily for us Android has an
elegant way of managing that through multiple xml layout folders.

On Jan 4, 6:38 pm, madcoder paperga...@gmail.com wrote:
 It's not so difficult to list requirements for an app - hopefully this
 will be available for the new market.  If your app requires a camera,
 then there should be a way to list that requirement before people
 download and/or pay for the app.

 The hardest part of development (to me) is the screen resolution/
 size.  Changing layouts on a 480 x 320 screen, from Portrait to
 landscape is troublesome enough that many developers may just lock in
 one of the two modes.  Never mind coding for a smaller (or larger
 screen size).

 Using layouts other than absolute layout is a must!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I set proper date and time on emulator?

2009-01-05 Thread Mark Murphy

Sarath Kamisetty wrote:
 I see that the date and time on my emulator are incorrect. How do I
 set the correct date and time ?

You need to tell the emulator your proper timezone via -timezone
timezone, where timezone is your timezone in zoneinfo format (e.g.,
America/New_York).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Error in native method Picture.nativeCreateFromStream()

2009-01-05 Thread Mike Reed

That method should not crash (I will fix that), but it is only
intended to re-create a picture that was previously written to a
stream. It does not know how to decode or interpreted images or other
data formats. Use BitmapFactory for that.

On Sun, Jan 4, 2009 at 11:29 AM, nickthecook nickthec...@gmail.com wrote:

 Hello all,

 I'm having some trouble creating a Picture from an InputStream. I am
 trying to do this:

ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
Picture pic = Picture.createFromStream(bis);

 The problem also occurs when I try to use an InputStream returned by
 ContentResolver.openInputStream(Uri):

InputStream is = getContentResolver.openInputStream(mUri);
Picture pic = Picture.createFromStream(is);

 Picture.createFromStream(InputStream) invokes the native method
 Picture.nativeCreateFromStream(InputStream, byte[]), and this is where
 the trail goes cold for me:

public static Picture createFromStream(InputStream stream) {
return new Picture(
nativeCreateFromStream(stream, new byte
 [WORKING_STREAM_STORAGE]));
}

 I have been loading images from this Uri (content://media/external/
 images/media/152) successfully for a while. I open an InputStream,
 read all the bytes, close the input stream, and there is no problem.
 However, when I try to use either the InputStream returned by
 ContentResolver.openInputStream(Uri), or I read all the bytes out of
 that and wrap them in a ByteArrayInputStream, Picture.createFromStream
 (InputStream) fails with the stack trace below.

 Has anyone successfully used Picture.createFromStream(InputStream)?

 === Stack Trace 
 I/dalvikvm-heap( 4776): Grow heap (frag case) to 5.940MB for 316-
 byte allocation
 D/dalvikvm( 4776): GC freed 371 objects / 20736 bytes in 89ms
 I/Image   ( 4776): Read 345682 bytes for 
 content://media/external/images/media/152.
 I/DEBUG   (   29): *** *** *** *** *** *** *** *** *** *** *** *** ***
 *** *** ***
 I/DEBUG   (   29): Build fingerprint: 'android-devphone1/
 dream_devphone/dream/trout:1.0/UNLOCKED/116222:userdebug/test-keys'
 I/DEBUG   (   29): pid: 4776, tid: 4776   org.hopto.group18.postbot
 
 I/DEBUG   (   29): signal 6 (SIGABRT), fault addr 12a8
 I/DEBUG   (   29):  r0   r1 0006  r2   r3 0080
 I/DEBUG   (   29):  r4 2eb0  r5 40008000  r6   r7 0025
 I/DEBUG   (   29):  r8 beb0a630  r9 4104d9c8  10 4104d9b8  fp 
 I/DEBUG   (   29):  ip   sp beb0a5c8  lr afe0ef37  pc
 afe0d1fc  cpsr 0010
 I/DEBUG   (   29):  #00  pc afe0d1fc  /system/lib/libc.so
 I/DEBUG   (   29):  #01  pc afe0ef34  /system/lib/libc.so
 I/DEBUG   (   29):  #02  pc ace08540  /system/lib/libcorecg.so
 I/DEBUG   (   29):  #03  pc ac075cec  /system/lib/libsgl.so
 I/DEBUG   (   29):  #04  pc ad3413da  /system/lib/
 libandroid_runtime.so
 I/DEBUG   (   29):  #05  pc ad00d9f4  /system/lib/libdvm.so
 I/DEBUG   (   29):  #06  pc ad04120e  /system/lib/libdvm.so
 I/DEBUG   (   29):  #07  pc ad012748  /system/lib/libdvm.so
 I/DEBUG   (   29):  #08  pc ad02a92c  /system/lib/libdvm.so
 I/DEBUG   (   29):  #09  pc ad0169d0  /system/lib/libdvm.so
 I/DEBUG   (   29):  #10  pc ad052096  /system/lib/libdvm.so
 I/DEBUG   (   29):  #11  pc ad03ccbc  /system/lib/libdvm.so
 I/DEBUG   (   29):  #12  pc ad012748  /system/lib/libdvm.so
 I/DEBUG   (   29):  #13  pc ad02a92c  /system/lib/libdvm.so
 I/DEBUG   (   29):  #14  pc ad0169d0  /system/lib/libdvm.so
 I/DEBUG   (   29):  #15  pc ad051f10  /system/lib/libdvm.so
 I/DEBUG   (   29):  #16  pc ad03f87a  /system/lib/libdvm.so
 I/DEBUG   (   29):  #17  pc ad3282b4  /system/lib/
 libandroid_runtime.so
 I/DEBUG   (   29):  #18  pc ad328d40  /system/lib/
 libandroid_runtime.so
 I/DEBUG   (   29):  #19  pc 8c12  /system/bin/app_process
 I/DEBUG   (   29):  #20  pc afe1dbd2  /system/lib/libc.so
 I/DEBUG   (   29):  #21  pc afe0b010  /system/lib/libc.so
 I/DEBUG   (   29):  #22  pc bd70  /system/bin/linker
 I/DEBUG   (   29): stack:
 I/DEBUG   (   29): beb0a588  beb0a630  [stack]
 I/DEBUG   (   29): beb0a58c  afe35f3c
 I/DEBUG   (   29): beb0a590  0084
 I/DEBUG   (   29): beb0a594  0001
 I/DEBUG   (   29): beb0a598  afe35f3c
 I/DEBUG   (   29): beb0a59c  000c
 I/DEBUG   (   29): beb0a5a0  afe35f3c
 I/DEBUG   (   29): beb0a5a4  afe12dbd  /system/lib/libc.so
 I/DEBUG   (   29): beb0a5a8  afe35f3c
 I/DEBUG   (   29): beb0a5ac  afe35f90
 I/DEBUG   (   29): beb0a5b0  
 I/DEBUG   (   29): beb0a5b4  afe1238d  /system/lib/libc.so
 I/DEBUG   (   29): beb0a5b8  ace0acc0  /system/lib/libcorecg.so
 I/DEBUG   (   29): beb0a5bc  afe11539  /system/lib/libc.so
 I/DEBUG   (   29): beb0a5c0  df002777
 I/DEBUG   (   29): beb0a5c4  

[android-developers] Re: Problem saving canvas to file

2009-01-05 Thread Mike Reed

Your code does not change bitmapOrg, but does create a new bitmap  
(whatever bitmap the canvas is drawing into). I expect you want to  
compress *that* bitmap to a file.

begin pseudo code

b = Bitmap.createBitmap(...);
c = new Canvas(b);
// now draw into c, e.g. c.drawBitmap(...), etc.
b.compress(...);

On Jan 4, 2009, at 8:26 AM, Protocol-X wrote:


Ive been searching all ove on how to edit a image and save it. The
only way i have come accross other than just changing the size or
orientation is to use canvas.  Now canvas works fine but i cannot seem
to save the newley created image.. the image always returns the
original image.


   @Override protected void onDraw(Canvas canvas) {

FileInputStream in = null;
try {
in = new FileInputStream(myimage.jpg);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Bitmap bitmapOrg = BitmapFactory.decodeStream(in);

int wd = bitmapOrg.getWidth();
int hd = bitmapOrg.getHeight();

canvas.drawBitmap(bitmapOrg, 0, 0, null);
canvas.drawBitmap(bitmapOrg, wd, 0, null);
canvas.drawBitmap(bitmapOrg, 0, hd, null);
canvas.drawBitmap(bitmapOrg, wd, hd, null);

canvas.save();

  FileOutputStream fos = null;
  try {
fos = new FileOutputStream(/sdcard/test.png);
} catch (FileNotFoundException e) {

e.printStackTrace();
}
bitmapOrg.compress(Bitmap.CompressFormat.PNG, 50, fos);

 try {
fos.close();
} catch (IOException e) {

e.printStackTrace();
}
}




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getLastKnownLocation is not working.

2009-01-05 Thread Mark Murphy

Amit Samel wrote:
 Hello guys,
 i am very much new to android platform. i am trying to implement some
 codes from Android: A Programmer’s Guide. i have installed latest sdk
 thats why there are  some issues regarding deprecated apis. when i was
 trying to call getCurrentLocation() i got error , that this method is
 not supported by LocationManager.So i had replaced it by
 getLastKnownLocation . but it got crashed. can any one knows why is
 this happening?
 this is my code.
   LocationManager myManager = (LocationManager)
   getSystemService(Context.LOCATION_SERVICE);
   Double latPoint = myManager.getLastKnownLocation(gps).getLatitude
 ();
   Double lngPoint = myManager.getLastKnownLocation(gps).getLongitude
 ();
 thanks .

You may be missing the appropriate permissions (e.g.,
ACCESS_FINE_LOCATION) in your AndroidManifest.xml file.

Note that location tracking changed fairly substantially between the M5
SDK from this summer and the current SDK.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Emulator crashing

2009-01-05 Thread Sundog

I am running it on Windows XP with Eclipse, and it does this every
time I quit the Emulator while it's running my app. I don't know if
it's always done it or not, I only noticed it recently.



On Jan 5, 10:26 am, David Turner di...@android.com wrote:
 On Mon, Jan 5, 2009 at 6:23 PM, Sundog michael_...@tmail.com wrote:

  I always get this too. I don't think it interferes with normal
  operation.

 thanks for pointing this out. Can you answer the same basic questions ?





  On Jan 4, 3:16 am, Vitaly vita...@gmail.com wrote:
   Hello,

   I'm just starting with Java, Eclipse and Android, so maybe no wonder I
   ran into the following problem:
   when I run an application from Eclipse, emulator starts, my simple app
   shows up, etc. But when I close the emulator, I get a Windows'
   standard error message Emulator.exe has stopped working and will be
   closed and another error message in the Eclipse's console window:
   [2009-01-04 12:23:06 - DeviceMonitor]Error reading jdwp list: EOF
   [2009-01-04 12:23:06 - DeviceMonitor]Connection Failure when starting
   to monitor device 'emulator-5554' : device (emulator-5554) request
   rejected: device not found

   I'd appreciate if someone could tell me what I'm doing wrong and how
   can I terminate the emulator correctly.

   Thanks,
   Vitaly- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: XML Schemas for Android namespaces?

2009-01-05 Thread Ward Willats

Hear hear. Even for those of us writing stuff by hand it would be useful.

I've been trying to get my head around what a definitive schema would 
be though. It seems like the way things like attrs.xml work (to 
define elements for custom controls) some of the XML grammar is 
defined at resource compile time by other XML. (A static schema would 
give you the meta-framework for this, but not the specific grammar 
for a particular compilation run.)

I'd still like to see the static schema though!

-- Ward


Hi!

I search for the XML schema defined by the namespace http://
schemas.android.com/apk/res/android. I know this has been asked
before, but that was over a year ago. Are this schema available
somewhere? It would be really great if these could be published as it
would make XML editing MUCH easier for those of us  who prefer
NetBeans or IntelliJ.

Any progress on publishing these? If not, is there any other
specification available so that we (the community) could create the
schemas outselves?

Thanks!

// Erik



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Restarting your own application

2009-01-05 Thread Andrew George
I have a scenario where I need to restart my own application. So basically I
need to do the equivalent of application.quit()/application.start... At the
very least I need to quit from within my application. Anyone have a code
sample on how to do this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Strange error for signed .apk

2009-01-05 Thread focuser

anyone?

On Jan 4, 9:04 pm, focuser linto...@gmail.com wrote:
 Hi,

 I have an app that runs well from Eclipse.  But when I signed it using
 our release key, it threw a ClassCastException embedded in an
 InflateException at start up time.  The code is something like the
 following:
                 this.content = (ViewGroup) findViewById(R.id.content);
 I'm pretty sure R.id.content represents a ViewGroup, but It complains
 that it is a Button!

 I managed to fix the problem by deleting the android:id attribute of
 an ImageView in the main layout xml.  However, this fix doesn't make
 sense to me at all.

 As more changes being added into the app, the error appeared again.

 Has anybody else encountered this problem?  Does this sound like a bug
 in Android?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Understanding animation repeat

2009-01-05 Thread Sundog

Perhaps a more specific question will help get a response: Am I using
the INFINITE and RESTART in SetRepeatCount and SetRepeatMode
correctly? Can someone tell me why this fires once, plays both
animations and then stops?

Thanks for any help, I have searched and found nothing.

On Jan 4, 7:05 pm, Sundog michael_...@tmail.com wrote:
 Hi, I need a bit of help understanding the animation repeat behavior.

 In the following code, the intention is for the first animation to
 run, then the second, then this sequence to repeat indefinitely.
 Instead, both animations run once and then it stops. What am I doing
 wrong?

         AnimationSet rootSet = new AnimationSet(true);
         rootSet.setInterpolator(new AccelerateInterpolator());

                        ScaleAnimation scale = new ScaleAnimation(
                                1, 1, 1, -1, // From x, to x, from y, to y
                                ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
                                ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
                                scale.setDuration(1600);
                                scale.setFillAfter(true);

                         ScaleAnimation scale2 = new ScaleAnimation(
                                        1, 1, -1, 1, // From x, to x, from y, 
 to
 y
                                        ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
                                        ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
                                         scale.setStartOffset(1600);
                                        scale.setDuration(1600);
                                        scale.setFillAfter(true);

                        AnimationSet childSet = new AnimationSet(true);
                        childSet.addAnimation(scale);
                        childSet.addAnimation(scale2);
                        childSet.setStartOffset(0);
                        childSet.setRepeatCount(Animation.INFINITE);
                        childSet.setRepeatMode(Animation.RESTART);
                       // childSet.addAnimation(rotate);

                        rootSet.addAnimation(childSet);

         ImageView b = (ImageView)findViewById(R.id.viewtoanimate);

         b.startAnimation(rootSet);

 Thanks in advance, I know it's something obvious.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do you create an MMS message with audio attachment?

2009-01-05 Thread Blake B.

Ok, digging into the com.android.mms.ui.ComposeMessageActivity
handleSendIntent() method, it appears as though only Image
attachments are expected in Intent Extras?  Does anyone have any
creative work-arounds of how to create/send an MMS message with an
audio attachment?

private void handleSendIntent(Intent intent) {
Bundle extras = intent.getExtras();

if (Intent.ACTION_SEND.equals(intent.getAction())  (extras !
= null)  extras.containsKey(Intent.EXTRA_STREAM)) {
Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM);
if (uri != null) {
convertMessage(true);
addImage(uri);   IMAGE IS
BEING ASSUMED
}
}
}

Will audio attachments via Intents be supported in the cupcake
release?  (I haven't downloaded it yet myself)

Thanks,
Blake


On Dec 30 2008, 8:52 pm, Blake B. bbuckle...@yahoo.com wrote:
 Hello all,

 I am trying to create an MMS message with an audio attachment and a
 message for the user to view and then click send themselves.  If you
 create a new Message on your own, you are able to attach an audio file
 (.amr in this case), but how do you do this programatically?

 When I do this code below, I get the MMS Compose Message window, but
 it gives an error message: Unsupported picture format.  Please select
 a different picture.:

         final Intent i = new Intent(Intent.ACTION_SEND);
         i.putExtra(sms_body, msgText);
         i.putExtra(Intent.EXTRA_STREAM, audioUri);
         i.setType(*/*);
         startActivity(i);

 When I run this code below (changed MIME type from */* to audio/*
 or audio/amr, Android instead brings up the GMail client with the
 audio attachment on the email:

         final Intent i = new Intent(Intent.ACTION_SEND);
         i.putExtra(sms_body, msgText);
         i.putExtra(Intent.EXTRA_STREAM, audioUri);
         i.setType(audio/*);
         startActivity(i);

 How can I direct the system to create an MMS message with a .amr
 attachment?

 Thanks,
 Blake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: quick questions about Skia in android

2009-01-05 Thread Mike Reed

Skia is a 2D engine for drawing to a bitmap. However, there is  
experimental support for a canvas that redirects its calls to a GL  
context, but this is not officially supported at the moment.

On Dec 31, 2008, at 3:15 AM, Andy Quan wrote:

Anyone knows what the relationship between Skia and OpenGL is?
Is Skia for 2D purpose only?
Is Skia in android accelarated by OpenGL(libagl)?

-- 
Regards,
Andy Quan




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Strange error for signed .apk

2009-01-05 Thread Al

Hi,
what does R.id.content represent, a LinearLayout, RelativeLayout,
TextView, etc? Try making an explicit cast to the appropriate type it
is.

On Jan 5, 5:54 pm, focuser linto...@gmail.com wrote:
 anyone?

 On Jan 4, 9:04 pm, focuser linto...@gmail.com wrote:

  Hi,

  I have an app that runs well from Eclipse.  But when I signed it using
  our release key, it threw a ClassCastException embedded in an
  InflateException at start up time.  The code is something like the
  following:
                  this.content = (ViewGroup) findViewById(R.id.content);
  I'm pretty sure R.id.content represents a ViewGroup, but It complains
  that it is a Button!

  I managed to fix the problem by deleting the android:id attribute of
  an ImageView in the main layout xml.  However, this fix doesn't make
  sense to me at all.

  As more changes being added into the app, the error appeared again.

  Has anybody else encountered this problem?  Does this sound like a bug
  in Android?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Strange error for signed .apk

2009-01-05 Thread Mark Murphy

I don't use Eclipse, and this kind of problem is one of the reasons.

It feels like a bug in your build process, whereby your generated R.java
file is not lining up with the actual resource XML file contents.

 On Jan 4, 9:04 pm, focuser linto...@gmail.com wrote:
 Hi,

 I have an app that runs well from Eclipse.  But when I signed it using
 our release key, it threw a ClassCastException embedded in an
 InflateException at start up time.  The code is something like the
 following:
 this.content = (ViewGroup) findViewById(R.id.content);
 I'm pretty sure R.id.content represents a ViewGroup, but It complains
 that it is a Button!

 I managed to fix the problem by deleting the android:id attribute of
 an ImageView in the main layout xml.  However, this fix doesn't make
 sense to me at all.

 As more changes being added into the app, the error appeared again.

 Has anybody else encountered this problem?  Does this sound like a bug
 in Android?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Commercial applications policy

2009-01-05 Thread Inderjeet Singh
One way you can address this is by providing each of the add-ons as
commercial applications themselves, and communicate between your main app,
and the add-ons via Intents.

AFAIK, If you try to charge outside of Market, you may violate Android
market's terms of service.
Inder

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Marketplace

2009-01-05 Thread Esteban Salazar
I'm curious what the deal is with the Android Marketplace.  It seems
like:

- You can't browse it or download apk files in the marketplace from a
desktop computer.  Just previews of a few apps.
- Marketplace is not installed in the emulator in the sdk
- Can't find anything on how to install it
- I've heard that people who are unlocking their G1 phones to use on
ATT can't access the marketplace.

All of these points could be confusion on my part as a newbie to the
Android development world.

So if these points are really correct could someone please explain why
all the restrictions and/or point me toward some documentation
regarding the reason and policies?

If I'm wrong can someone please explain a)Where can I browse the
marketplace from a normal desktop and/or b)where can I get and apk I
can install in the emulator to browse the marketplace.

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Al Sutton

Marketplace is a closed source app that Google is in control of and 
developing it as it sees fit.

There are other alternatives that allow you to brows apps from your 
destop, download apks, etc., etc., if you'd like to try one you can take 
a look at http://andappstore.com/

Al.

eags wrote:
 I'm curious what the deal is with the Android Marketplace.  It seems
 like:

 - You can't browse it or download apk files in the marketplace from a
 desktop computer.  Just previews of a few apps.
 - Marketplace is not installed in the emulator in the sdk
 - Can't find anything on how to install it
 - I've heard that people who are unlocking their G1 phones to use on
 ATT can't access the marketplace.

 All of these points could be confusion on my part as a newbie to the
 Android development world.

 So if these points are really correct could someone please explain why
 all the restrictions and/or point me toward some documentation
 regarding the reason and policies?

 If I'm wrong can someone please explaine a)Where can I browse the
 marketplace from a normal desktop and b)where can I get and apk I can
 install in the emulator to browse the marketplace.

 Thanks.

 
   


-- 
==
Funky Android Limited is registered in England  Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Marketplace

2009-01-05 Thread Shane Isbell
On Mon, Jan 5, 2009 at 10:01 AM, Esteban Salazar eagsala...@gmail.comwrote:


 If I'm wrong can someone please explain a)Where can I browse the
 marketplace from a normal desktop and/or b)where can I get and apk I
 can install in the emulator to browse the marketplace.

Google's Android Market client isn't part of the standard Android
distribution, so you don't have access to the apk. You could try out SAM:
http://slideme.org/sam2.apk. It is a client for the SlideME Marketplace.
Some people create iso's of Android with SAM on it, as it is the closet
thing to the Android Market.

This week, we are releasing SAM 2.3, which will provide support for paid
applications.

Shane

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Orientation change on non-front activity?

2009-01-05 Thread Keith Wiley

Here's an interesting dilemma.  My app detects and reacts to
orientation changes (through a screen-flip-open/close on the G1 for
example) through the onPause/onResume/onCreate methods without any
trouble.  It handles them and keeps rolling with the correct
behavior...but, if someone opens a second, temporary activity, for
example, the preferences activity incorporated into my app, and then
flips the orientation while in that secondary activity, and then
closes it to return to the primary activity, then my program crashes,
and I have determined that the problem is that the primary activity
didn't receive a onPause/onResume/onCreate call and consequently
didn't rebuild its UI properly.

What's the proper way to handle this?  Do I have to manually send a
message from the secondary activity when it notices the orientation
flip to the primary activity so it knows to rebuild itself?

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Dan Dumont
I think the point of his post was that he wants to browse THE marketplace,
not andappstore's marketplace...

I'd like to know how as well.


On Mon, Jan 5, 2009 at 1:03 PM, Al Sutton a...@funkyandroid.com wrote:


 Marketplace is a closed source app that Google is in control of and
 developing it as it sees fit.

 There are other alternatives that allow you to brows apps from your
 destop, download apks, etc., etc., if you'd like to try one you can take
 a look at http://andappstore.com/

 Al.

 eags wrote:
  I'm curious what the deal is with the Android Marketplace.  It seems
  like:
 
  - You can't browse it or download apk files in the marketplace from a
  desktop computer.  Just previews of a few apps.
  - Marketplace is not installed in the emulator in the sdk
  - Can't find anything on how to install it
  - I've heard that people who are unlocking their G1 phones to use on
  ATT can't access the marketplace.
 
  All of these points could be confusion on my part as a newbie to the
  Android development world.
 
  So if these points are really correct could someone please explain why
  all the restrictions and/or point me toward some documentation
  regarding the reason and policies?
 
  If I'm wrong can someone please explaine a)Where can I browse the
  marketplace from a normal desktop and b)where can I get and apk I can
  install in the emulator to browse the marketplace.
 
  Thanks.
 
  
 


 --
 ==
 Funky Android Limited is registered in England  Wales with the
 company number  6741909. The registered head office is Kemp House,
 152-160 City Road, London,  EC1V 2NX, UK.

 The views expressed in this email are those of the author and not
 necessarily those of Funky Android Limited, it's associates, or it's
 subsidiaries.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Dan Dumont
There is a method that will get called when the version number you supply to
the create db command exceeds the listed version that the user has ( you've
upgraded your design )

You then put code in that handler to handle the database schema updates.
Sorry I can't be more specific...  my code is at home.

On Mon, Jan 5, 2009 at 3:34 AM, Jean-Baptiste Queru j...@google.com wrote:


 You might find SQLiteOpenHelper useful to manage the various scenarios.

 JBQ

 On 1/5/09, Jay-andro jayan...@gmail.com wrote:
 
  I have an app that creates an sqllite database on first-use, if one
  doesn't already exist. Recently I released a new version of the app,
  and all of a sudden several users are complaining of erros that I
  didnt encounter in my testing. In my development I always installed
  using adb over usb, which in turn requires uninstall the older version
  first. So the database was always created anew on first-use of the new
  version. But I suspect my existing users are doing an in-place install
  on top of their old version, in which case the old db is incompatible
  with the new one.
 
  So my questions are:
  - Does the Market app allow you to install a new version on top of
  an old one, without requiring an uninstall first (unlike adb)?
  - If an in-place upgrade is supported but the database is not dropped,
  the question arises what else is not deleted? Resources, preferences,
  manifest? I suspect there would be major havoc if these things werent
  completely removed  replaced by the new version.
 
  I am now contemplating adding a preference which will indicate to the
  app what version of my db it needs and use this on first-use to
  determine if I need to drop and recreate the database or just use the
  old db.
 
  Any thoughts?
  
 


 --
 Jean-Baptiste M. JBQ Queru
 Android Engineer, Google.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android Limitation on Instrumentation

2009-01-05 Thread sundar

Hey guys, I was instrumenting my application in which I came across a
scenario... where i need to launch and pick a contact from phone book
contacts application. Here in Instrumentation I was able to launch the
phone book contacts app, but I was not able to select a contact from
it using,
 sendKeySync(KeyEvent.KEYCODE_DPAD_CENTER). The phone book contacts
app is not responding to any of the events that I send and  also I had
no control on it through instrumentation.
Is this a Android Limitation on Instrumentation? if not, could anyone
suggest me some ways of doing it.

- Sundar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Remapping Key Functions

2009-01-05 Thread Raghu D K

Hello All,

How do I map the keys to perform specific functions depending on the
application ?
For example:

Key 108 DPOD_UP  // For scrolling up in a Browser application
Key 108 VOLUME_UP // For Volume increase in the a Multimetia application


Warm Regards,
Raghu

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Set Window Titile

2009-01-05 Thread mscwd01

How do you set/change the title of the Activities window? I am
currently using this code but it has absolutley no effect:

@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

// Set Window Title
getWindow().setTitle(Title of window);

setContentView(R.layout.main_layout);

   ...
}

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Shane Isbell
On Mon, Jan 5, 2009 at 10:11 AM, Dan Dumont ddum...@gmail.com wrote:

 I think the point of his post was that he wants to browse THE marketplace,
 not andappstore's marketplace...

 I'd like to know how as well.

Google does not currently allow browsing of applications from the web. My
understanding is that they have this feature in the works. There is one site
out there that has managed to obtain all of the Android Market catalog,
including comments. This is against Google's terms, so I won't name them
here.

Shane




 On Mon, Jan 5, 2009 at 1:03 PM, Al Sutton a...@funkyandroid.com wrote:


 Marketplace is a closed source app that Google is in control of and
 developing it as it sees fit.

 There are other alternatives that allow you to brows apps from your
 destop, download apks, etc., etc., if you'd like to try one you can take
 a look at http://andappstore.com/

 Al.

 eags wrote:
  I'm curious what the deal is with the Android Marketplace.  It seems
  like:
 
  - You can't browse it or download apk files in the marketplace from a
  desktop computer.  Just previews of a few apps.
  - Marketplace is not installed in the emulator in the sdk
  - Can't find anything on how to install it
  - I've heard that people who are unlocking their G1 phones to use on
  ATT can't access the marketplace.
 
  All of these points could be confusion on my part as a newbie to the
  Android development world.
 
  So if these points are really correct could someone please explain why
  all the restrictions and/or point me toward some documentation
  regarding the reason and policies?
 
  If I'm wrong can someone please explaine a)Where can I browse the
  marketplace from a normal desktop and b)where can I get and apk I can
  install in the emulator to browse the marketplace.
 
  Thanks.
 
  
 


 --
 ==
 Funky Android Limited is registered in England  Wales with the
 company number  6741909. The registered head office is Kemp House,
 152-160 City Road, London,  EC1V 2NX, UK.

 The views expressed in this email are those of the author and not
 necessarily those of Funky Android Limited, it's associates, or it's
 subsidiaries.





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Reporting Exceptions

2009-01-05 Thread kelvin

Is there a built-in or easy scheme to have users report exceptions to
a developer?  I understand that you could try to get users to hook up
a USB cable and run 'adb', but I don't think that's realistic.

I'm running into a crash that appears to occur on a very small number
of handsets, possibly while accessing the SD card, and trying to track
this down remotely is driving me nuts.  Thanks in advance.

-kelvin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] setSelection fails on onNewIntent

2009-01-05 Thread devileper

I have created a singleton ListActivity which accepts a selection
index as an intent extra.  However, calling setSelection(index) works
during onCreate but fails during onNewIntent.  Is there a way to
work around this?


public class PositionActivity extends ListActivity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* ... standard initialization ... */
setSelection(getIntent().getIntExtra(position, 0);
}

@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setSelection(intent.getIntExtra(position, 0);
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] setSelection fails on onNewIntent

2009-01-05 Thread devileper

I have created a singleton ListActivity which accepts a selection
index as an intent extra.  However, calling setSelection(index) works
during onCreate but fails during onNewIntent.  Is there a way to
work around this?


public class PositionActivity extends ListActivity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* ... standard initialization ... */
setSelection(getIntent().getIntExtra(position, 0);
}

@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setSelection(intent.getIntExtra(position, 0);
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread eags

That is a real shame that they have decided to do that.  What we are
seeing with the major fragmentation of places to get android apps from
is the result and will get worse if this policy continues.  Once we go
beyond a certain point people will be used to it and the fragmentation
will be almost impossible to repair.  The term marketplace and
google's all apps are created equal mantra for Android both suggest
an open and collaborative environment which is exactly what this is
not.  Really a shame.  I was hoping for something like Youtube's
interface for browsing, rating, commenting on apps and purchasing.


On Jan 5, 10:33 am, Shane Isbell shane.isb...@gmail.com wrote:
 On Mon, Jan 5, 2009 at 10:11 AM, Dan Dumont ddum...@gmail.com wrote:
  I think the point of his post was that he wants to browse THE marketplace,
  not andappstore's marketplace...

  I'd like to know how as well.

 Google does not currently allow browsing of applications from the web. My
 understanding is that they have this feature in the works. There is one site
 out there that has managed to obtain all of the Android Market catalog,
 including comments. This is against Google's terms, so I won't name them
 here.

 Shane



  On Mon, Jan 5, 2009 at 1:03 PM, Al Sutton a...@funkyandroid.com wrote:

  Marketplace is a closed source app that Google is in control of and
  developing it as it sees fit.

  There are other alternatives that allow you to brows apps from your
  destop, download apks, etc., etc., if you'd like to try one you can take
  a look athttp://andappstore.com/

  Al.

  eags wrote:
   I'm curious what the deal is with the Android Marketplace.  It seems
   like:

   - You can't browse it or download apk files in the marketplace from a
   desktop computer.  Just previews of a few apps.
   - Marketplace is not installed in the emulator in the sdk
   - Can't find anything on how to install it
   - I've heard that people who are unlocking their G1 phones to use on
   ATT can't access the marketplace.

   All of these points could be confusion on my part as a newbie to the
   Android development world.

   So if these points are really correct could someone please explain why
   all the restrictions and/or point me toward some documentation
   regarding the reason and policies?

   If I'm wrong can someone please explaine a)Where can I browse the
   marketplace from a normal desktop and b)where can I get and apk I can
   install in the emulator to browse the marketplace.

   Thanks.

  --
  ==
  Funky Android Limited is registered in England  Wales with the company 
  number 6741909. The registered head office is Kemp House,
  152-160 City Road, London,  EC1V 2NX, UK.

  The views expressed in this email are those of the author and not
  necessarily those of Funky Android Limited, it's associates, or it's
  subsidiaries.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getLastKnownLocation is not working.

2009-01-05 Thread Keiji Ariyama

Hi Amir,

Where did you test that code? Emulator or dev phone?

 You may be missing the appropriate permissions (e.g.,
 ACCESS_FINE_LOCATION) in your AndroidManifest.xml file.
Mark is right.
Additionally, I suppose that cause of crash is null pointer exception.

 Double latPoint = myManager.getLastKnownLocation(gps).getLatitude
Here is.

If GPS is not working, the app doesn't have appropriate permissions or 
the phone couldn't determine location, getLastKnownLocation method 
return null.

If you test on emulator, you have to send location infomation to 
emulator[adb] by DDMS.

If you test on dev phone, you would test below code.


Double latPoint = null;
Double lngPoint = null;

Location loc = myManager.getLastKnownLocation(gps);
if(loc != null) {
   latPoint = myManager.getLastKnownLocation(gps).getLatitude();
   lngPoint = myManager.getLastKnownLocation(gps).getLongitude();

} else {
   Log.d(location, location is null);
}


cheers,
keiji

Mark Murphy wrote:
 Amit Samel wrote:
 Hello guys,
 i am very much new to android platform. i am trying to implement some
 codes from Android: A Programmer’s Guide. i have installed latest sdk
 thats why there are  some issues regarding deprecated apis. when i was
 trying to call getCurrentLocation() i got error , that this method is
 not supported by LocationManager.So i had replaced it by
 getLastKnownLocation . but it got crashed. can any one knows why is
 this happening?
 this is my code.
  LocationManager myManager = (LocationManager)
  getSystemService(Context.LOCATION_SERVICE);
  Double latPoint = myManager.getLastKnownLocation(gps).getLatitude
 ();
  Double lngPoint = myManager.getLastKnownLocation(gps).getLongitude
 ();
 thanks .
 
 You may be missing the appropriate permissions (e.g.,
 ACCESS_FINE_LOCATION) in your AndroidManifest.xml file.
 
 Note that location tracking changed fairly substantially between the M5
 SDK from this summer and the current SDK.
 

-- 
Keiji,
ml_andr...@c-lis.co.jp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Orientation change on non-front activity?

2009-01-05 Thread Keith Wiley

Nevermind...sorta...the solution was to move the UI rebuilding routine
from onActivityResult to onResume.  The problem seemed to stem from
the exactly order in which onCreate, onActivityResult, and onResume
are called upon return to the primary activity.  Cuidado!  :-)

On Jan 5, 10:09 am, Keith Wiley kbwi...@gmail.com wrote:
 Here's an interesting dilemma.  My app detects and reacts to
 orientation changes (through a screen-flip-open/close on the G1 for
 example) through the onPause/onResume/onCreate methods without any
 trouble.  It handles them and keeps rolling with the correct
 behavior...but, if someone opens a second, temporary activity, for
 example, the preferences activity incorporated into my app, and then
 flips the orientation while in that secondary activity, and then
 closes it to return to the primary activity, then my program crashes,
 and I have determined that the problem is that the primary activity
 didn't receive a onPause/onResume/onCreate call and consequently
 didn't rebuild its UI properly.

 What's the proper way to handle this?  Do I have to manually send a
 message from the secondary activity when it notices the orientation
 flip to the primary activity so it knows to rebuild itself?

 Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Blake B.

When you extend SQLiteOpenHelper, override this method:

public void onUpgrade(final SQLiteDatabase db, final int 
oldVersion,
final int newVersion)

It will be called when your application is being updated with a newer
version.


On Jan 5, 8:52 am, Dan Dumont ddum...@gmail.com wrote:
 There is a method that will get called when the version number you supply to
 the create db command exceeds the listed version that the user has ( you've
 upgraded your design )

 You then put code in that handler to handle the database schema updates.
 Sorry I can't be more specific...  my code is at home.

 On Mon, Jan 5, 2009 at 3:34 AM, Jean-Baptiste Queru j...@google.com wrote:

  You might find SQLiteOpenHelper useful to manage the various scenarios.

  JBQ

  On 1/5/09, Jay-andro jayan...@gmail.com wrote:

   I have an app that creates an sqllite database on first-use, if one
   doesn't already exist. Recently I released a new version of the app,
   and all of a sudden several users are complaining of erros that I
   didnt encounter in my testing. In my development I always installed
   using adb over usb, which in turn requires uninstall the older version
   first. So the database was always created anew on first-use of the new
   version. But I suspect my existing users are doing an in-place install
   on top of their old version, in which case the old db is incompatible
   with the new one.

   So my questions are:
   - Does the Market app allow you to install a new version on top of
   an old one, without requiring an uninstall first (unlike adb)?
   - If an in-place upgrade is supported but the database is not dropped,
   the question arises what else is not deleted? Resources, preferences,
   manifest? I suspect there would be major havoc if these things werent
   completely removed  replaced by the new version.

   I am now contemplating adding a preference which will indicate to the
   app what version of my db it needs and use this on first-use to
   determine if I need to drop and recreate the database or just use the
   old db.

   Any thoughts?

  --
  Jean-Baptiste M. JBQ Queru
  Android Engineer, Google.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Dan Dumont
It may very well become what you say...it's just not there yet(tm)...

I hope they put some effort into at least putting the app in the
emulator...
I'd really like to be able to see what kinds of apps are out there.

On Mon, Jan 5, 2009 at 1:39 PM, eags eagsala...@gmail.com wrote:


 That is a real shame that they have decided to do that.  What we are
 seeing with the major fragmentation of places to get android apps from
 is the result and will get worse if this policy continues.  Once we go
 beyond a certain point people will be used to it and the fragmentation
 will be almost impossible to repair.  The term marketplace and
 google's all apps are created equal mantra for Android both suggest
 an open and collaborative environment which is exactly what this is
 not.  Really a shame.  I was hoping for something like Youtube's
 interface for browsing, rating, commenting on apps and purchasing.


 On Jan 5, 10:33 am, Shane Isbell shane.isb...@gmail.com wrote:
  On Mon, Jan 5, 2009 at 10:11 AM, Dan Dumont ddum...@gmail.com wrote:
   I think the point of his post was that he wants to browse THE
 marketplace,
   not andappstore's marketplace...
 
   I'd like to know how as well.
 
  Google does not currently allow browsing of applications from the web. My
  understanding is that they have this feature in the works. There is one
 site
  out there that has managed to obtain all of the Android Market catalog,
  including comments. This is against Google's terms, so I won't name them
  here.
 
  Shane
 
 
 
   On Mon, Jan 5, 2009 at 1:03 PM, Al Sutton a...@funkyandroid.com
 wrote:
 
   Marketplace is a closed source app that Google is in control of and
   developing it as it sees fit.
 
   There are other alternatives that allow you to brows apps from your
   destop, download apks, etc., etc., if you'd like to try one you can
 take
   a look athttp://andappstore.com/
 
   Al.
 
   eags wrote:
I'm curious what the deal is with the Android Marketplace.  It seems
like:
 
- You can't browse it or download apk files in the marketplace from
 a
desktop computer.  Just previews of a few apps.
- Marketplace is not installed in the emulator in the sdk
- Can't find anything on how to install it
- I've heard that people who are unlocking their G1 phones to use on
ATT can't access the marketplace.
 
All of these points could be confusion on my part as a newbie to the
Android development world.
 
So if these points are really correct could someone please explain
 why
all the restrictions and/or point me toward some documentation
regarding the reason and policies?
 
If I'm wrong can someone please explaine a)Where can I browse the
marketplace from a normal desktop and b)where can I get and apk I
 can
install in the emulator to browse the marketplace.
 
Thanks.
 
   --
   ==
   Funky Android Limited is registered in England  Wales with the
 company number 6741909. The registered head office is Kemp House,
   152-160 City Road, London,  EC1V 2NX, UK.
 
   The views expressed in this email are those of the author and not
   necessarily those of Funky Android Limited, it's associates, or it's
   subsidiaries.
 
 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android Shell

2009-01-05 Thread Raghu D K

Hello All,

I am using logcat to debug. I have noticed that the Android shell
does not have the export PATH variable exporting the path to
/system/bin where the logcat is located.
Some times on the android shell when I do

# set
 It shows the following

# set
HOME=/
IFS='
'
OPTIND=1
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PS1='# '
PS2=' '
PS4='+ '
PWD=/
SHELL=/bin/sh
TERM=vt102
USER=root
_=


And some times it shows:
# set
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=9,32768
ANDROID_ROOT=/system
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
EXTERNAL_STORAGE=/sdcard
IFS='
'
LD_LIBRARY_PATH=/system/lib
OPTIND=1
PATH=/sbin:/system/sbin:/system/bin:/system/xbin
PS1='# '
PS2=' '
PS4='+ '
PWD=/system/bin
_=/sys/class/power_supply/bq27000/capacity


Any clues as to why this behaviour ?

warm Regards,
Raghu



Warm Regards,
Raghu

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Sensor readings on demand

2009-01-05 Thread clark

Hi all,

I'm currently working on an application that needs to detect various
types of motion using the accelerometer.  I'd like to get readings
from the accelerometer on demand, rather than using onSensorChanged()
so that I can take samples at a given time interval.  Is this possible
with the current SDK (1.0 R2)?

It looks like this was available about a year ago when the SDK was in
its infancy, but has since been removed.

Any help or information regarding this would be greatly appreciated.


Thanks,
~Clark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Jay-andro

Thanks all, for bringing the SQLiteOpenHelper.OnUpgrade method to my
attention. Reading up on it, I'm not clear on a couple of things:

- When exactly does it fire - when a new version of the app is
installed, or when the new app first tries to open the database, or
when the new app tries to create a database when one already exists?
- For this to work, do we need to call SQLiteDatabase.setVersion when
we create the database or does the version get set by default to the
appversion?
- When the onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) method fires, it receives the database version in
oldVersion and the appversionname (from manifest file) in newVersion?
is this correct?

thanks in advance
Jay

On Jan 4, 7:39 pm, shaunke...@gmail.com shaunke...@gmail.com
wrote:
 Are you using a class that extends SQLiteOpenHelper to open your DB.
 You should be able to specify a version number then override the
 onUpgrade method in your SQLiteOpenHelper to update your db from
 earlier versions.

 See:http://code.google.com/android/reference/android/database/sqlite/SQLi...
 and look at the NotePad tutorial.

 On Jan 4, 6:45 pm,Jay-androjayan...@gmail.com wrote:

  I have an app that creates an sqllite database on first-use, if one
  doesn't already exist. Recently I released a new version of the app,
  and all of a sudden several users are complaining of erros that I
  didnt encounter in my testing. In my development I always installed
  using adb over usb, which in turn requires uninstall the older version
  first. So the database was always created anew on first-use of the new
  version. But I suspect my existing users are doing an in-place install
  on top of their old version, in which case the old db is incompatible
  with the new one.

  So my questions are:
  - Does the Market app allow you to install a new version on top of
  an old one, without requiring an uninstall first (unlike adb)?
  - If an in-place upgrade is supported but the database is not dropped,
  the question arises what else is not deleted? Resources, preferences,
  manifest? I suspect there would be major havoc if these things werent
  completely removed  replaced by the new version.

  I am now contemplating adding a preference which will indicate to the
  app what version of my db it needs and use this on first-use to
  determine if I need to drop and recreate the database or just use the
  old db.

  Any thoughts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sensor readings on demand

2009-01-05 Thread Dan Dumont
well...   does onSeonsorchanged fire whenever the accelerometer changes?

save the values when they change and read the saved values whenever you need
to.

On Mon, Jan 5, 2009 at 1:50 PM, clark clarkd...@gmail.com wrote:


 Hi all,

 I'm currently working on an application that needs to detect various
 types of motion using the accelerometer.  I'd like to get readings
 from the accelerometer on demand, rather than using onSensorChanged()
 so that I can take samples at a given time interval.  Is this possible
 with the current SDK (1.0 R2)?

 It looks like this was available about a year ago when the SDK was in
 its infancy, but has since been removed.

 Any help or information regarding this would be greatly appreciated.


 Thanks,
 ~Clark
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: FTP Client

2009-01-05 Thread Derek

And you also have a full FTP client (AndFTP) with upload, download,
rename, delete, chmod and more at:
http://www.lysesoft.com/products/andftp/index.html

Hope it helps.

On Nov 27 2008, 10:15 am, Derek cram.de...@gmail.com wrote:
 FTPwith Android is possible. You have aFTPworking client for
 Android at:http://www.lysesoft.com/products/s3-bucketupload-android/

 Derek.

 On Nov 21, 9:41 am, friedger fried...@googlemail.com wrote:

  I think I saw a package like com.android.ftpor similar but I can't
  find it on the device anymore after an update. Maybe the package might
  be of some use.

  Friedger

  On 20 Nov., 18:41, Sahil R Cooner m...@sahilcooner.com wrote:

   nothing that I know of, but if you're working on one that you'd like
   help on I'd be willing to join in on the project.

   On Wed, Nov 19, 2008 at 02:03:22PM -0800, Phubeone wrote:

Is anyone out there working on aFTPclient for Android or does anyone
know if one is already available?  I have been looking for awhile and
haven't found anything.

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Dan Dumont
when you request a new or existing database you can provide a number
(version of the db schema you are using)

you should keep track of this, as it will be passed to your upgrade handler.


On Mon, Jan 5, 2009 at 1:51 PM, Jay-andro jayan...@gmail.com wrote:


 Thanks all, for bringing the SQLiteOpenHelper.OnUpgrade method to my
 attention. Reading up on it, I'm not clear on a couple of things:

 - When exactly does it fire - when a new version of the app is
 installed, or when the new app first tries to open the database, or
 when the new app tries to create a database when one already exists?
 - For this to work, do we need to call SQLiteDatabase.setVersion when
 we create the database or does the version get set by default to the
 appversion?
 - When the onUpgrade(SQLiteDatabase db, int oldVersion, int
 newVersion) method fires, it receives the database version in
 oldVersion and the appversionname (from manifest file) in newVersion?
 is this correct?

 thanks in advance
 Jay

 On Jan 4, 7:39 pm, shaunke...@gmail.com shaunke...@gmail.com
 wrote:
  Are you using a class that extends SQLiteOpenHelper to open your DB.
  You should be able to specify a version number then override the
  onUpgrade method in your SQLiteOpenHelper to update your db from
  earlier versions.
 
  See:
 http://code.google.com/android/reference/android/database/sqlite/SQLi...
  and look at the NotePad tutorial.
 
  On Jan 4, 6:45 pm,Jay-androjayan...@gmail.com wrote:
 
   I have an app that creates an sqllite database on first-use, if one
   doesn't already exist. Recently I released a new version of the app,
   and all of a sudden several users are complaining of erros that I
   didnt encounter in my testing. In my development I always installed
   using adb over usb, which in turn requires uninstall the older version
   first. So the database was always created anew on first-use of the new
   version. But I suspect my existing users are doing an in-place install
   on top of their old version, in which case the old db is incompatible
   with the new one.
 
   So my questions are:
   - Does the Market app allow you to install a new version on top of
   an old one, without requiring an uninstall first (unlike adb)?
   - If an in-place upgrade is supported but the database is not dropped,
   the question arises what else is not deleted? Resources, preferences,
   manifest? I suspect there would be major havoc if these things werent
   completely removed  replaced by the new version.
 
   I am now contemplating adding a preference which will indicate to the
   app what version of my db it needs and use this on first-use to
   determine if I need to drop and recreate the database or just use the
   old db.
 
   Any thoughts?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Dan Dumont
sorry... it's in the constructor of the helper

http://code.google.com/android/reference/android/database/sqlite/SQLiteOpenHelper.html#SQLiteOpenHelper(android.content.Context,%20java.lang.String,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20int)

On Mon, Jan 5, 2009 at 1:54 PM, Dan Dumont ddum...@gmail.com wrote:

 when you request a new or existing database you can provide a number
 (version of the db schema you are using)

 you should keep track of this, as it will be passed to your upgrade
 handler.



 On Mon, Jan 5, 2009 at 1:51 PM, Jay-andro jayan...@gmail.com wrote:


 Thanks all, for bringing the SQLiteOpenHelper.OnUpgrade method to my
 attention. Reading up on it, I'm not clear on a couple of things:

 - When exactly does it fire - when a new version of the app is
 installed, or when the new app first tries to open the database, or
 when the new app tries to create a database when one already exists?
 - For this to work, do we need to call SQLiteDatabase.setVersion when
 we create the database or does the version get set by default to the
 appversion?
 - When the onUpgrade(SQLiteDatabase db, int oldVersion, int
 newVersion) method fires, it receives the database version in
 oldVersion and the appversionname (from manifest file) in newVersion?
 is this correct?

 thanks in advance
 Jay

 On Jan 4, 7:39 pm, shaunke...@gmail.com shaunke...@gmail.com
 wrote:
  Are you using a class that extends SQLiteOpenHelper to open your DB.
  You should be able to specify a version number then override the
  onUpgrade method in your SQLiteOpenHelper to update your db from
  earlier versions.
 
  See:
 http://code.google.com/android/reference/android/database/sqlite/SQLi...
  and look at the NotePad tutorial.
 
  On Jan 4, 6:45 pm,Jay-androjayan...@gmail.com wrote:
 
   I have an app that creates an sqllite database on first-use, if one
   doesn't already exist. Recently I released a new version of the app,
   and all of a sudden several users are complaining of erros that I
   didnt encounter in my testing. In my development I always installed
   using adb over usb, which in turn requires uninstall the older version
   first. So the database was always created anew on first-use of the new
   version. But I suspect my existing users are doing an in-place install
   on top of their old version, in which case the old db is incompatible
   with the new one.
 
   So my questions are:
   - Does the Market app allow you to install a new version on top of
   an old one, without requiring an uninstall first (unlike adb)?
   - If an in-place upgrade is supported but the database is not dropped,
   the question arises what else is not deleted? Resources, preferences,
   manifest? I suspect there would be major havoc if these things werent
   completely removed  replaced by the new version.
 
   I am now contemplating adding a preference which will indicate to the
   app what version of my db it needs and use this on first-use to
   determine if I need to drop and recreate the database or just use the
   old db.
 
   Any thoughts?
 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] XML PULL PARSER

2009-01-05 Thread Sudha

Hi
I am tryting to read an xml file of the format
response
statusname/name/status
gravityg1/g1/gravity
/response

My xml pull parser is reading till to
status.but its not reading the gravity tag.
it reached ENd_DOCUMENT after reading /status

I understood that xmlpullparser can read only one level..
any idea ablout resolving the issue ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: battery level

2009-01-05 Thread The Spirit

how can i get the battery level?
is this only a one line code for obtaining the level?
or do i have to pull to the battery?
thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Sleeping thread vs. new thread

2009-01-05 Thread Noonien Soong

I am currently working on some communications code. Basically I am
sending HTTP Requests to my server at an interval of lets say around
100 ms.

The code is neatly placed in a Service and I am using threads in order
not to block my UI.

What I have right now is basically a cycle like this.

1. Schedule a handler to call a runnable

myHandler.postDelayed(myRunnable, 100); // 100 ms

2. Inside the runnable's run method I create a new Thread Object.

mThread = new Thread( this);


3. Then I run the thread.

 mThread.start();

4. the run-method of the thread finishes at some point, either because
e.g. a timeout-exception occured or because it finished after it
received and correctly handled the server's response.

5. If everything's fine, I will then post the handler again. Back to 1
== loop!

I've seen a lot of Java-examples online that all contain a loop inside
the thread's run-method which is constantly paused using .sleep() and
then runs again in order to do the work.

I am wondering wether my approach is ok in Android. While I am aware
that there must be some overhead when I create a new Thread object for
each cycle,
I wonder if it makes a huge difference, and if maybe the implications
of having a thread constanly sleeping in memory ( especially if it is
inactive for a longer time ) might not be bigger? I somehow feel it's
not an elegant solution to have a while loop in a thread with a sleep
simply to keep it alive


Any comments grealty appreciated!




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Get the screen resolution

2009-01-05 Thread Nico

Hi,
I need to get the screen resolution, how can I get it ?
Thx.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Orientation within orientation

2009-01-05 Thread Mark Murphy

Sundog wrote:
 How can I have a main layout with a vertical orientation and have
 some text appear within it in a horizontal orientation?
 
 Even though my app is used horizontally, I use a vertical layout to
 get the title bar out of the way and get maximum vertical screen real
 estate. But I need the ability to display a TextView that is rotated
 90 degrees so as to appear normal in a horizontal layout. Can this be
 done, short of using an animation?
 

Why not just get rid of the title bar?

getWindow().requestFeature(Window.FEATURE_NO_TITLE);

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Sending Mail Error

2009-01-05 Thread Rahul

hi
i am trying to send mail programatically by Using Android. i write
following code by Using Intent but it shows Error Noapplication can
perform this action. plz tel me any Extra setting are required or wt
is the problem
My Code is

protected void sendEmail() {
// Setup the recipient in a String array
String[] mailto = { emailTo.getText().toString() };
//String[] ccto = { som...@somedomain.com };
// Create a new Intent to send messages
Intent sendIntent = new Intent(Intent.ACTION_SEND);
// Add attributes to the intent
sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
//sendIntent.putExtra(Intent.EXTRA_CC, ccto);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject.getText()
.toString());
sendIntent.putExtra(Intent.EXTRA_TEXT, 
emailBody.getText().toString
());
// sendIntent.setType(message/rfc822);
sendIntent.setType(text/plain);
startActivity(Intent.createChooser(sendIntent, MySendMail));
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What happens to the database when app is upgraded

2009-01-05 Thread Noonien Soong

Is the database version number a private number that the developer of
each application comes up with? If so, I don't think is is terribly
understandable from the documentation.





On Jan 5, 1:56 pm, Dan Dumont ddum...@gmail.com wrote:
 sorry... it's in the constructor of the helper

 http://code.google.com/android/reference/android/database/sqlite/SQLi...)

 On Mon, Jan 5, 2009 at 1:54 PM, Dan Dumont ddum...@gmail.com wrote:
  when you request a new or existing database you can provide a number
  (version of the db schema you are using)

  you should keep track of this, as it will be passed to your upgrade
  handler.

  On Mon, Jan 5, 2009 at 1:51 PM, Jay-andro jayan...@gmail.com wrote:

  Thanks all, for bringing the SQLiteOpenHelper.OnUpgrade method to my
  attention. Reading up on it, I'm not clear on a couple of things:

  - When exactly does it fire - when a new version of the app is
  installed, or when the new app first tries to open the database, or
  when the new app tries to create a database when one already exists?
  - For this to work, do we need to call SQLiteDatabase.setVersion when
  we create the database or does the version get set by default to the
  appversion?
  - When the onUpgrade(SQLiteDatabase db, int oldVersion, int
  newVersion) method fires, it receives the database version in
  oldVersion and the appversionname (from manifest file) in newVersion?
  is this correct?

  thanks in advance
  Jay

  On Jan 4, 7:39 pm, shaunke...@gmail.com shaunke...@gmail.com
  wrote:
   Are you using a class that extends SQLiteOpenHelper to open your DB.
   You should be able to specify a version number then override the
   onUpgrade method in your SQLiteOpenHelper to update your db from
   earlier versions.

   See:
 http://code.google.com/android/reference/android/database/sqlite/SQLi...
   and look at the NotePad tutorial.

   On Jan 4, 6:45 pm,Jay-androjayan...@gmail.com wrote:

I have an app that creates an sqllite database on first-use, if one
doesn't already exist. Recently I released a new version of the app,
and all of a sudden several users are complaining of erros that I
didnt encounter in my testing. In my development I always installed
using adb over usb, which in turn requires uninstall the older version
first. So the database was always created anew on first-use of the new
version. But I suspect my existing users are doing an in-place install
on top of their old version, in which case the old db is incompatible
with the new one.

So my questions are:
- Does the Market app allow you to install a new version on top of
an old one, without requiring an uninstall first (unlike adb)?
- If an in-place upgrade is supported but the database is not dropped,
the question arises what else is not deleted? Resources, preferences,
manifest? I suspect there would be major havoc if these things werent
completely removed  replaced by the new version.

I am now contemplating adding a preference which will indicate to the
app what version of my db it needs and use this on first-use to
determine if I need to drop and recreate the database or just use the
old db.

Any thoughts?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to write code to uninstall apk from device/emulator?

2009-01-05 Thread Mark Murphy

Kenny Yu wrote:
 Simply put the cmd to Java function:
 system(adb uninstall apt_name);
 I mean your code should invoke the commands exactly as 'adb' does.
 
 Kenny
 
 On Jan 3, 8:52 am, Dr. Tingrong Lu lutingr...@hotmail.com wrote:
 Hi,

 How to write code to uninstall apk from device/emulator? Could anyone drop a 
 sample code? Thanks a lot!

If the original poster was trying to uninstall an APK from within the
device, I believe Shane Isbell is correct, and it cannot be done.

In particular, system(adb uninstall apt_name) will not work -- adb is
not an installed executable on the device, and I'm not sure there is a
working system() call that would execute it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Name of a widget

2009-01-05 Thread Mark Murphy

Nico wrote:
 I am looking for the name of the widget which can slide up.
 There is one on the desktop, it can be shown be clicking on a button
 on the bottom.

AFAIK, that widget is not available to SDK applications.

You can find the source code for it in the Android Git repository:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/com/android/internal/widget/SlidingDrawer.java

(or http://tinyurl.com/a3x6fe if that URL is too long for your mail client).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] how to switch gmail account attached to the gphone?

2009-01-05 Thread CJ

what i understand is there must be an gmail account attached to a
gphone. my question is how to switch it to another gmail account and
how to do so programmatically.
thx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with screenshot

2009-01-05 Thread Noonien Soong

what type is the this in your question? If it's a View, then you can
simpy use this.. A View is a Context.

On Dec 17 2008, 3:40 am, Dec. 030440...@163.com wrote:
   hi,guys~!
   i've been playing around on g-phone test for a few days,But i'm
 really confused on how to get current screenshot,One way is to use
 getrootview()-getdrawingcache() method,providing that a View on the
 screen is already known ;But the statusbar is lost,What's more,if i
 launch an activity from an instrumentation class,i just couldn't get
 any View presently shown on the screen,so i tryed to make it the
 following way,but it also makes no sense:
 first new a View based on the target context:
   View v=new View(this.getTargetContext());
 Then i tryed the focussearch() method and several others provided in
 the SDK,but i got nothing but the nonepointer exception,真TM郁闷。。

 So, Any idears ??
 Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Shane Isbell
On Mon, Jan 5, 2009 at 10:39 AM, eags eagsala...@gmail.com wrote:


 That is a real shame that they have decided to do that.  What we are
 seeing with the major fragmentation of places to get android apps from
 is the result and will get worse if this policy continues.  Once we go
 beyond a certain point people will be used to it and the fragmentation
 will be almost impossible to repair.  The term marketplace and
 google's all apps are created equal mantra for Android both suggest
 an open and collaborative environment which is exactly what this is
 not.

It's pretty clear that Google wants to control the distribution channel for
mobile content. Fortunately, Android is open enough that other smaller
players can enter the market. In fact SlideME Marketplace has been around a
lot longer than the Android Marketplace. My expectation is that Google is
going to be a ruthless in trying to knock out competition, so the
fragmentation may not be as bad as you suggest.

When we started out on the SAM client and SlideME over a year ago, we fully
expected that Google Market would be tightly controlled and that there would
be a big chunk of revenue taken out of the developer's pocket. They haven't
disappointed. Our strategy has been to focus on openness and maximum payout
to the developer and it is working pretty well for us and the developers.

Also Google is making obvious mistakes that an experienced mobile player
wouldn't make, both in terms of the Android Marketplace design, as well as
the client. Now that we have the billing issue cracked, you'll see a
widening gap between SlideME Marketplace and Android Market (in what I
believe will be our favor). We've put in a lot of groundwork that we are
just now starting to capitalize on. So a little fragmentation here is not so
bad for the developer or the user.

Shane

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Deployment of native C library

2009-01-05 Thread Anonymous Anonymous
adb remount

then try again

On Sun, Jan 4, 2009 at 12:45 PM, shimo...@gmail.com shimo...@gmail.comwrote:


 Hi,

 Did as you suggested from my Windows PC (using adb shell).
 The 'mount' command did not yield any error.
 But - saw no change in the \system attributes (using ls -l).
 And - when I try to do adb push MySans.ttf \system\fonts\MySans.ttf
 I get an error message:
 failed to copy ...: read-only file system

 Any ideas ?

 Thanks !


 On Jan 2, 5:27 pm, Joel Knighton joel.knigh...@gmail.com wrote:
  Issue the commands in this order (from a terminal on the device,
 otherwise
  change to use adb shell).
 
  $su
  #mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
 
  Add/change anything you need, then revert to read only.
 
  $su
  #mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
 
 
 
  On Fri, Jan 2, 2009 at 12:31 AM, Margaret mawei...@gmail.com wrote:
 
   add sudo where you do mount .
 
   mawei...@gmail.com
   13585201588
 
   2009/1/2 shimo...@gmail.com shimo...@gmail.com:
 
Hi,
 
Thanks !
 
Where do I issue this command from ?
 
When I do this from PTerminal on my Android device it hangs, then
issues
a warning box saying:
 
Activity pTerminal (in application pTerminal) is not responding
 
Do you have a Dev Phone ?
 
Thanks.
 
On Jan 2, 3:39 am, Joel joel.knigh...@gmail.com wrote:
Sounds as if you don't have root.  Did you issue a su command first?
 
On Jan 1, 6:11 pm, shimo...@gmail.com shimo...@gmail.com wrote:
 
 Hi,
 
 Tried that on my Dev Phone, and got mount: operation not
 permitted
 
 Can you tell me why ?
 
 TIA
 
 On Nov 17 2008, 11:48 am, li chen freep...@gmail.com wrote:
 
  You can use adb shell toremount/system and try again:
  mount -oremountrw /system
 
  -freepine
 
  --
  Joel Knighton
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: set up a redirection from A:localhost:localPort to B:10.0.2.15:serverPort

2009-01-05 Thread Fred Grott(shareme)

maybe I am asleep this morning but coudl you not use No-ip.com's app
and free service to do the same without having to type al the
redirects?

I have used it when I needed to do redirects for facebook app
development.


On Jan 5, 4:58 am, Sanak mathib...@gmail.com wrote:
 I am working on Ubuntu 6.1 with ARM Processor and I am working on TCP/
 IP related activities in Open source through emulator.  I have created
 my project in /bin/external/MySampleproject.
 Now I want to redirect my virtual IP( 10.0.2.15 ) to physical IP.  I
 tried with port rediection with the following commands.
 redir add tcp:5556:5556

 Shall I get some detailed information regarding IP redirection to read
 and send data??? and Can I have some steps for that ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: button response is slow on GPhone

2009-01-05 Thread cindy

Mark,

Thank you for the reply. I found that if I use trackball, it always
work for click. But the response from hand touch is really not very
responsible. Have you tried to use G1?

Have some other developer experience the same problem?

Thanks!

Cindy

On Jan 5, 4:47 am, Mark Murphy mmur...@commonsware.com wrote:
 cindy wrote:
  In my application, all thebuttonhasButtonOnClickListenner,

  createB=(Button)findViewById(R.id.newUser);
   createB.setOnClickListener(new createAccount());

  It works very well in simulator. However, after I load the application
  to Gphone, I found thebuttondoesn't alwaysresponseto touch.
  sometimes I need to touch it many times. What other listenner I need
  to add to thebutton? Why ?

 I am not sure what the Gphone is. I am assuming you are referring to
 the T-Mobile G1 or the Android Dev Phone 1.

 You do not need to add other listeners -- setOnClickListener() should
 suffice. Perhaps yourbuttonis too small, or there is something running
 on your device that is consuming too much of the available CPU time, or
 perhaps your device's touchscreen has a defect.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com

 Android Training on the Ranch! -- Mar 16-20, 
 2009http://www.bignerdranch.com/schedule.shtml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Disconnect
You realize they could have simply disabled the third-party-installer
option, right? (Or not written one to begin with.)  They are far more than
an application vendor in this space, and if they really wanted to control
the distribution channel for mobile content they could have. (Also, that
big chunk of revenue is completely spelled out, and the fingers get
pointed at the carriers, not at google. Its the price of getting to be part
of the out of box image.)

But its good to know you and Al will be here to jump up and down advertising
your respective services anytime a question mentions the google market..

On Mon, Jan 5, 2009 at 2:11 PM, Shane Isbell shane.isb...@gmail.com wrote:

 It's pretty clear that Google wants to control the distribution channel for
 mobile content. Fortunately, Android is open enough that other smaller
 players can enter the market. In fact SlideME Marketplace has been around a
 lot longer than the Android Marketplace. My expectation is that Google is
 going to be a ruthless in trying to knock out competition, so the
 fragmentation may not be as bad as you suggest.

 When we started out on the SAM client and SlideME over a year ago, we fully
 expected that Google Market would be tightly controlled and that there would
 be a big chunk of revenue taken out of the developer's pocket. They haven't
 disappointed. Our strategy has been to focus on openness and maximum payout
 to the developer and it is working pretty well for us and the developers.

 Also Google is making obvious mistakes that an experienced mobile player
 wouldn't make, both in terms of the Android Marketplace design, as well as
 the client. Now that we have the billing issue cracked, you'll see a
 widening gap between SlideME Marketplace and Android Market (in what I
 believe will be our favor). We've put in a lot of groundwork that we are
 just now starting to capitalize on. So a little fragmentation here is not so
 bad for the developer or the user.

 Shane


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: button response is slow on GPhone

2009-01-05 Thread Mark Murphy

cindy wrote:
 Thank you for the reply. I found that if I use trackball, it always
 work for click. But the response from hand touch is really not very
 responsible. Have you tried to use G1?

Frequently.

Let's flip the problem around: do you have problems with other buttons
in other applications, applications you did not write?

If you do, perhaps there is some software that is causing your G1 to
behave poorly, such as Locale.

If you do not, then we know your hardware is fine and it is something
with your application.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Fast Scroll drag handle similar to Contacts ListView

2009-01-05 Thread Romain Guy

Hi,

The FastScrollView is currently implemented in the Contacts
application itself. It will be part of a future SDK update though.

You can find the current implementation in the source code at
http://source.android.com

On Tue, Dec 2, 2008 at 4:48 AM, Will Ryan willrya...@googlemail.com wrote:

 I have a ListView which contains over a thousand entries (sorted from
 A to Z) and want to know how to scroll this quickly similar to how the
 Contacts list can be scrolled quickly (by dragging the handle that
 appears on the right hand side of the screen).

 How can this be achieved? Is it an option for the view, or do I have
 to implement it? Alternatively, is it possible to see the source of
 the Contacts ListView as I could probably reuse that.

 Thanks.

 




-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Marketplace?

2009-01-05 Thread Shane Isbell
On Mon, Jan 5, 2009 at 11:18 AM, Disconnect dc.disconn...@gmail.com wrote:

 You realize they could have simply disabled the third-party-installer
 option, right? (Or not written one to begin with.)  They are far more than
 an application vendor in this space, and if they really wanted to control
 the distribution channel for mobile content they could have.

No they couldn't have. This shows a lack of understanding of the mobile
industry on your part. The carriers could have just told Google: Tough
luck, go find another market to play in. Carriers would not have allowed
Google to enter, if they thought Google would lock down and control
everything. The openness of Android is some type of assurance against this.

Shane

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



  1   2   >