[android-developers] Re: How to decode large resolution Images

2009-05-06 Thread vishal bhoj
Can Anyone help me on this ?
On Tue, May 5, 2009 at 6:31 PM, bhoj vishalb...@gmail.com wrote:


 Hello All,

 I want to decode high resolution pics something like 8 mega pixel
 images and view it. when I try to decode them I get out of memory
 exception. Decoding of single 8 mega pixel also fails . From the
 Imagamanager code and other post I could use BitmapFactory.Options
 inJustDecodeBounds I could get a scaled down version of the Image .

  Bitmap Bm =
   BitmapFactory.decodeResource(getResources
 (),R.drawable.two,opts);
   opts.inJustDecodeBounds=false;
   opts.inSampleSize =8;
  Bm =  BitmapFactory.decodeResource(getResources(),R.drawable.two,
 opts);
   imageView.setImageBitmap(Bm);

 Is there any way to decode part of the Image and fill it on the screen
 and by scrolling decode other reagion of the image and display it.

 Any pointers on this would be appreciated,


  Thanks in advance,

 Bhoj

 



-- 
with regards vishal

--~--~-~--~~~---~--~~
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 draw directly on screen without calling invalidate?

2009-05-06 Thread Dianne Hackborn
You can look at the Touch Paint API demo as an example of one approach.

On Tue, May 5, 2009 at 9:04 PM, Sukitha Udugamasooriya suk...@gmail.comwrote:


 Thanks. Is there a way to save the Canvas object on re-draw that in
 the onDraw()??
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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 show soft keyboard in landscape mode?

2009-05-06 Thread Dianne Hackborn
If you are on a G1, the default behavior of InputMethodService is not to be
shown when there is a hardware keyboard available.

On Tue, May 5, 2009 at 8:21 PM, Yan Shi shiyansu...@gmail.com wrote:


 I tried a lot of ways with no luck. Could anyone please help me?

 Thanks
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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] Access my own provider in another app

2009-05-06 Thread quill

Hi all,
I hava build a notepad application just like the notepad sample in
sdk.It has a NotePadProvider.
Now in another application I want to insert or delete a record in
notepad database, how should I do this? Can I use NotePadProvider?
how?

I know that how to insert a record in contacts:
 ContentValues person = new ContentValues();
 person.put(Contacts.People.NAME, android);
 getContentResolver().insert(Contacts.People.CONTENT_URI, person);
I just want my notepad can realize this!

Anyone knows?
Thank you 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] Dx Tool

2009-05-06 Thread Sergio Ciruela

Hi,

I would like to know where i can find a how-to about DX tool.

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: Access my own provider in another app

2009-05-06 Thread Dianne Hackborn
Link the NotePadProvider class into the second application and just use it
the same way as you would in the original app.

On Tue, May 5, 2009 at 11:22 PM, quill quill...@163.com wrote:


 Hi all,
 I hava build a notepad application just like the notepad sample in
 sdk.It has a NotePadProvider.
 Now in another application I want to insert or delete a record in
 notepad database, how should I do this? Can I use NotePadProvider?
 how?

 I know that how to insert a record in contacts:
 ContentValues person = new ContentValues();
 person.put(Contacts.People.NAME, android);
 getContentResolver().insert(Contacts.People.CONTENT_URI, person);
 I just want my notepad can realize this!

 Anyone knows?
 Thank you in advance!
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Access my own provider in another app

2009-05-06 Thread quill

Hi Dianne,
I have try this, just to
import com.example.android.notepad.NotePadProvider;
but eclipse shows me an error.


On May 6, 2:31 pm, Dianne Hackborn hack...@android.com wrote:
 Link the NotePadProvider class into the second application and just use it
 the same way as you would in the original app.





 On Tue, May 5, 2009 at 11:22 PM, quill quill...@163.com wrote:

  Hi all,
  I hava build a notepad application just like the notepad sample in
  sdk.It has a NotePadProvider.
  Now in another application I want to insert or delete a record in
  notepad database, how should I do this? Can I use NotePadProvider?
  how?

  I know that how to insert a record in contacts:
      ContentValues person = new ContentValues();
      person.put(Contacts.People.NAME, android);
      getContentResolver().insert(Contacts.People.CONTENT_URI, person);
  I just want my notepad can realize this!

  Anyone knows?
  Thank you in advance!

 --
 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, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- 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: Access my own provider in another app

2009-05-06 Thread Dianne Hackborn
You need to statically link it into your app (sorry I can't help with
exactly how to do this with ADT, I do my work in the platform build system).

On Tue, May 5, 2009 at 11:37 PM, quill quill...@163.com wrote:


 Hi Dianne,
 I have try this, just to
 import com.example.android.notepad.NotePadProvider;
 but eclipse shows me an error.


 On May 6, 2:31 pm, Dianne Hackborn hack...@android.com wrote:
  Link the NotePadProvider class into the second application and just use
 it
  the same way as you would in the original app.
 
 
 
 
 
  On Tue, May 5, 2009 at 11:22 PM, quill quill...@163.com wrote:
 
   Hi all,
   I hava build a notepad application just like the notepad sample in
   sdk.It has a NotePadProvider.
   Now in another application I want to insert or delete a record in
   notepad database, how should I do this? Can I use NotePadProvider?
   how?
 
   I know that how to insert a record in contacts:
   ContentValues person = new ContentValues();
   person.put(Contacts.People.NAME, android);
   getContentResolver().insert(Contacts.People.CONTENT_URI, person);
   I just want my notepad can realize this!
 
   Anyone knows?
   Thank you in advance!
 
  --
  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, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.- Hide quoted text -
 
  - Show quoted text -
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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 1.5: How to get the BT state?

2009-05-06 Thread Nick Pelly

There is a simple bug in your code. Try looking in the source for
other examples of the use of BLUETOOTH_STATE_CHANGED and you should
quickly see what you have done wrong.

Sorry not going to spoon feed you for private API's.

Nick

On Tue, May 5, 2009 at 10:45 PM, so_is festival.s...@googlemail.com wrote:

 Is there new information about that problem?

 On Apr 25, 9:41 am, scanning_it festival.s...@googlemail.com wrote:
 Well after testing the whole thing I recognized that the state is not
 delivered via an Intent extra. (although mentioned in the SDK)

 Here is what I tried:

         Log.e(TAG,Received Bt change. Change action: +intent.getAction
 ());
         int state = intent.getIntExtra(BLUETOOTH_STATE, 404);
         int previousState = intent.getIntExtra
 (BLUETOOTH_PREVIOUS_STATE, 404);

 The action is fine but the states are always 404. So there is no state
 returned.

 Could you lead me to the file where you have found the things you
 mentioned. I haven't found it in the source. :(

 Thank you very much.

 Regards.

 On Apr 25, 9:11 am, scanning_it festival.s...@googlemail.com wrote:

  Thank you very much. I am aware that it is not part of the public
  API. :)

  On Apr 24, 10:41 pm, Nick Pelly npe...@google.com wrote:

   On Fri, Apr 24, 2009 at 7:09 AM, code_android_festival_way 

   festival.s...@googlemail.com wrote:

At the moment I am trying to update my application to Android 1.5.

In Android 1.1 I was able to detect the BT state with catching the
following broadcasts:

action android:name=android.bluetooth.intent.action.ENABLED /
action android:name=android.bluetooth.intent.action.DISABLED /
action
android:name=android.bluetooth.intent.action.REMOTE_DEVICE_FOUND /
action
android:name=android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECTED
 /

action
android:name=android.bluetooth.intent.action.REMOTE_DEVICE_CONNECTED 
/

action
android:name=android.bluetooth.intent.action.BONDING_CREATED /

After testing with Android 1.5 I recognized that only:

action
android:name=android.bluetooth.intent.action.BLUETOOTH_STATE_CHANGED 
/

   1) These are not part of the public API. If you use them it is at your 
   own
   risk, and your app will probably break again going forward beyond 
   cupcake.

   2) Your question is easily answered by looking at the source.

       /** Broadcast when the local Bluetooth device state changes, for 
   example
        *  when Bluetooth is enabled. Will contain int extra's 
   BLUETOOTH_STATE
   and
        *  BLUETOOTH_PREVIOUS_STATE. */
       @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
       public static final String BLUETOOTH_STATE_CHANGED_ACTION =
           android.bluetooth.intent.action.BLUETOOTH_STATE_CHANGED;

is available.

How can I detect the specific state of Bluetooth in 1.5? With the
settings I can only differentiate between BT on and off.

I'm looking forward reading your answer.
 


--~--~-~--~~~---~--~~
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: Access my own provider in another app

2009-05-06 Thread quill

No problem, I will find it out!

On May 6, 2:41 pm, Dianne Hackborn hack...@android.com wrote:
 You need to statically link it into your app (sorry I can't help with
 exactly how to do this with ADT, I do my work in the platform build system).





 On Tue, May 5, 2009 at 11:37 PM, quill quill...@163.com wrote:

  Hi Dianne,
  I have try this, just to
  import com.example.android.notepad.NotePadProvider;
  but eclipse shows me an error.

  On May 6, 2:31 pm, Dianne Hackborn hack...@android.com wrote:
   Link the NotePadProvider class into the second application and just use
  it
   the same way as you would in the original app.

   On Tue, May 5, 2009 at 11:22 PM, quill quill...@163.com wrote:

Hi all,
I hava build a notepad application just like the notepad sample in
sdk.It has a NotePadProvider.
Now in another application I want to insert or delete a record in
notepad database, how should I do this? Can I use NotePadProvider?
how?

I know that how to insert a record in contacts:
    ContentValues person = new ContentValues();
    person.put(Contacts.People.NAME, android);
    getContentResolver().insert(Contacts.People.CONTENT_URI, person);
I just want my notepad can realize this!

Anyone knows?
Thank you in advance!

   --
   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, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.- Hide quoted text -

   - Show quoted text -

 --
 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, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- 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: Lost focus on soft keyboard

2009-05-06 Thread Yossi

Anyone has this issue or am I doing something wrong?

On May 2, 11:51 am, Yossi yossi@gmail.com wrote:
 Hi,

 I implemented a custom preference screen on which I have an EditText
 control. The problem I have is when the user clicks on the EditText
 control to enter data, thesoftkeyboardpops-up and the EditText
 loses the focus which makes it impossible to enter data.
 What do I do wrong?

 Thanks,
 Yossi
--~--~-~--~~~---~--~~
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: Update application from the Android Market

2009-05-06 Thread Mariano Kamp
How do you know that the process is still running?
I've never seen this behavior. It's the other way around. The app is updated
so cleanly that it forgets scheduled alarms.

From what I know I think that an upgrade is an uninstall (removing the
alarms and the running process) and install. So besides old shortcuts
pointing to an activity that might not be available in the new app, or stuff
that your app created on the SD card (*), you should start from scratch, but
keep what's in /data/data/yourapp/files/ (your dbs for example).

I am happy to be corrected.

(*) There doesn't seem to be any lifecycle event that the app is going to be
uninstalled. Does anybody have a solution for cleaning up the SD card in
such a case?

On Tue, May 5, 2009 at 12:30 PM, David C dcampi...@gmail.com wrote:


 Hi,

 After different testing, I found an issue with the update method
 when installing an application update.

 I developped DilbertDroid, and a lot of people are saying that there
 is missing some functionnality but the latest version published on the
 market have this functionnalities.

 I suppose that when updating a application, the updater doesn't kill
 the process related to the application but only update the application
 files on phone. Result: the old application is still running until you
 kill the process or reboot the system.

 I think it is not very professionnal to tell user to deinstall and
 then reboot their phone in order to install an update.


 David

 PS: My application doesn't have any service running

 


--~--~-~--~~~---~--~~
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: Update application from the Android Market

2009-05-06 Thread Dianne Hackborn
You are wrong, when installing an update all processes of the current
version are killed.  You can test this yourself by doing adb install -r
path-to-apk

On Tue, May 5, 2009 at 3:30 AM, David C dcampi...@gmail.com wrote:


 Hi,

 After different testing, I found an issue with the update method
 when installing an application update.

 I developped DilbertDroid, and a lot of people are saying that there
 is missing some functionnality but the latest version published on the
 market have this functionnalities.

 I suppose that when updating a application, the updater doesn't kill
 the process related to the application but only update the application
 files on phone. Result: the old application is still running until you
 kill the process or reboot the system.

 I think it is not very professionnal to tell user to deinstall and
 then reboot their phone in order to install an update.


 David

 PS: My application doesn't have any service running

 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Lost focus on soft keyboard

2009-05-06 Thread Dianne Hackborn
IMEs do not take input focus, so I don't really understand what you are
describing.  What behavior are you seeing that is different than how the IME
behaves in other parts of the UI?

On Tue, May 5, 2009 at 11:47 PM, Yossi yossi@gmail.com wrote:


 Anyone has this issue or am I doing something wrong?

 On May 2, 11:51 am, Yossi yossi@gmail.com wrote:
  Hi,
 
  I implemented a custom preference screen on which I have an EditText
  control. The problem I have is when the user clicks on the EditText
  control to enter data, thesoftkeyboardpops-up and the EditText
  loses the focus which makes it impossible to enter data.
  What do I do wrong?
 
  Thanks,
  Yossi
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Lost focus on soft keyboard

2009-05-06 Thread Yossi

1. User clicks on the EditText
2. Soft keyboard pops-up and EditText loses the focus. Any typing on
the keyboard does nothing
3. User touches again the EditText to get focus
4. Now, any click on the keyboard shows the character for a second in
the EditText but then it disappears.

Thanks.

On May 6, 10:11 am, Dianne Hackborn hack...@android.com wrote:
 IMEs do not take input focus, so I don't really understand what you are
 describing.  What behavior are you seeing that is different than how the IME
 behaves in other parts of the UI?





 On Tue, May 5, 2009 at 11:47 PM, Yossi yossi@gmail.com wrote:

  Anyone has this issue or am I doing something wrong?

  On May 2, 11:51 am, Yossi yossi@gmail.com wrote:
   Hi,

   I implemented a custom preference screen on which I have an EditText
   control. The problem I have is when the user clicks on the EditText
   control to enter data, thesoftkeyboardpops-up and the EditText
   loses the focus which makes it impossible to enter data.
   What do I do wrong?

   Thanks,
   Yossi

 --
 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, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
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: Lost focus on soft keyboard

2009-05-06 Thread Dianne Hackborn
You'll need to supply code that demonstrates the problem.  Given that this
behavior is nothing like the standard behavior of EditText anywhere else in
the system, here must be something in your code instigating it.

On Wed, May 6, 2009 at 12:24 AM, Yossi yossi@gmail.com wrote:


 1. User clicks on the EditText
 2. Soft keyboard pops-up and EditText loses the focus. Any typing on
 the keyboard does nothing
 3. User touches again the EditText to get focus
 4. Now, any click on the keyboard shows the character for a second in
 the EditText but then it disappears.

 Thanks.

 On May 6, 10:11 am, Dianne Hackborn hack...@android.com wrote:
  IMEs do not take input focus, so I don't really understand what you are
  describing.  What behavior are you seeing that is different than how the
 IME
  behaves in other parts of the UI?
 
 
 
 
 
  On Tue, May 5, 2009 at 11:47 PM, Yossi yossi@gmail.com wrote:
 
   Anyone has this issue or am I doing something wrong?
 
   On May 2, 11:51 am, Yossi yossi@gmail.com wrote:
Hi,
 
I implemented a custom preference screen on which I have an EditText
control. The problem I have is when the user clicks on the EditText
control to enter data, thesoftkeyboardpops-up and the EditText
loses the focus which makes it impossible to enter data.
What do I do wrong?
 
Thanks,
Yossi
 
  --
  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, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.
 



-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: reset to paid or completely remove the old free apps from Market?

2009-05-06 Thread MrChaz

You can't convert a free app to a paid one unfortunately.
I ended up renaming the package and then changing the title of the old
one on the market.

On May 5, 10:42 pm, jman chunyen...@gmail.com wrote:
 I certainly would like to keep using the old name for the paid version
 of the software but I did not seem to find a way of resetting it to
 paid or removing the old free version entirely so that I can upload
 the brand new software.

 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: Lost focus on soft keyboard

2009-05-06 Thread Yossi

this is the layout
?xml version=1.0 encoding=utf-8?

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:id=@+android:id/widget_frame
android:orientation=vertical
android:padding=10px
android:layout_width=fill_parent
android:layout_height=fill_parent
TextView
android:text=@string/settings_text_email
android:layout_width=wrap_content
android:layout_height=wrap_content
android:textSize=24px
android:textColor=#ff
android:gravity=left
android:paddingLeft=3dip/
TextView
android:text=@string/settings_text_email_info
android:layout_width=wrap_content
android:layout_height=wrap_content
android:textColor=#ff
android:textSize=14px
android:gravity=left
android:paddingLeft=3dip/
LinearLayout
android:orientation=horizontal
android:gravity=left|top
android:layout_width=fill_parent
android:layout_height=fill_parent
EditText
android:id=@+id/settings_edit_email
android:text=
android:layout_width=248px
android:layout_height=wrap_content
android:textColor=#262626
android:textSize=16px
android:gravity=left|center/
   Button android:id=@+id/settings_button_save
android:text=@string/settings_button_save
android:layout_width=52px
android:layout_height=44px
android:gravity=left|center/
/LinearLayout

/LinearLayout

and this is the code

import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class EditEmailPreference extends Preference implements
View.OnClickListener
{
private EditText _emailEditText;

public EditEmailPreference(Context context, AttributeSet attrs)
{
super(context, attrs);
setLayoutResource(R.layout.settings_email);
}

@Override
protected void onBindView(View view)
{
super.onBindView(view);

_emailEditText = (EditText) view.findViewById
(R.id.settings_edit_email);
_emailEditText.setText(getPersistedString());
Button saveButton = (Button) view.findViewById
(R.id.settings_button_save);
saveButton.setOnClickListener(this);
}

@Override
public void onClick(View v)
{
persistString(_emailEditText.getText().toString());
}
}

Thanks for your help.

On May 6, 10:50 am, Dianne Hackborn hack...@android.com wrote:
 You'll need to supply code that demonstrates the problem.  Given that this
 behavior is nothing like the standard behavior of EditText anywhere else in
 the system, here must be something in your code instigating it.





 On Wed, May 6, 2009 at 12:24 AM, Yossi yossi@gmail.com wrote:

  1. User clicks on the EditText
  2. Soft keyboard pops-up and EditText loses the focus. Any typing on
  the keyboard does nothing
  3. User touches again the EditText to get focus
  4. Now, any click on the keyboard shows the character for a second in
  the EditText but then it disappears.

  Thanks.

  On May 6, 10:11 am, Dianne Hackborn hack...@android.com wrote:
   IMEs do not take input focus, so I don't really understand what you are
   describing.  What behavior are you seeing that is different than how the
  IME
   behaves in other parts of the UI?

   On Tue, May 5, 2009 at 11:47 PM, Yossi yossi@gmail.com wrote:

Anyone has this issue or am I doing something wrong?

On May 2, 11:51 am, Yossi yossi@gmail.com wrote:
 Hi,

 I implemented a custom preference screen on which I have an EditText
 control. The problem I have is when the user clicks on the EditText
 control to enter data, thesoftkeyboardpops-up and the EditText
 loses the focus which makes it impossible to enter data.
 What do I do wrong?

 Thanks,
 Yossi

   --
   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, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.

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

 Note: please 

[android-developers] Re: BUGS ? something strange about class SQLiteQueryBuilder

2009-05-06 Thread Jacky Boy

Thanks for your reply.

What about the second question ?


On May 4, 12:58 pm, Romain Guy romain...@google.com wrote:
  Q1: Method appendWhere can only append ONE query condition? why it
  named append?

 Read the javadoc
 (http://d.android.com/reference/android/database/sqlite/SQLiteQueryBui...)).

 Append a chunk to the WHERE clause of the query. All chunks appended
 are surrounded by parenthesis and ANDed with the selection passed to
 query(SQLiteDatabase, String[], String, String[], String, String,
 String). The final WHERE clause looks like: WHERE (append chunk
 1append chunk2) AND (query() selection parameter)

 So the behavior you are seeing is exactly what's described. If you
 want to AND several conditions using appendWhere, you must put the AND
 in each chunk.

 --
 Romain Guy
 Android framework engineer
 romain...@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
--~--~-~--~~~---~--~~
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] AppWidget Position

2009-05-06 Thread Mr.No

Hello,
how do i get the position of the App.Widget on screen?
--~--~-~--~~~---~--~~
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] EditText for App.Widget

2009-05-06 Thread Mr.No

Hello,
in which Android-SDK version their will be a EditText for the
App.Widget?
--~--~-~--~~~---~--~~
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] OAuth on Android

2009-05-06 Thread Matthias

Hey guys,

I have recently been working on an OAuth library that has been
designed to play well with Apache HttpComponents 4 (and thus, Android
of course). If you're looking for a straight forward way to do client-
side OAuth on Android, check it out (literally) here:
http://code.google.com/p/oauth-signpost

I'd like to get feedback / suggestions / contributions from my fellow
Android developers (that would be you!).

Cheers,
Matthias

PS: there is also a slightly opinionated (hence missing on the project
homepage) rationale for why I started this project on my blog:
http://brainflush.wordpress.com/2009/05/03/introducing-signpost-easy-oauth-for-java-and-apache-httpcomponents-android-too/
--~--~-~--~~~---~--~~
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: When GPS goes off?

2009-05-06 Thread Mohamed Amir

Is it that hard?

On Apr 24, 6:36 pm, Mohamed Amir mohamed.a...@gmail.com wrote:
 I am working on an application that requires getting location using
 GPS.

 I registered a listener to get GPS location updates.  The location
 manager keeps reporting GPS locations for sometime and then stops
 reporting according to the updates frequency I requested.

 I couldn't understand when the GPS decides to stop reporting.  I have
 written logs for the accuracy of the reported locations and the number
 of satellites, but I couldn't correlate that with the duration of the
 GPS being ON.

 Please, what are the parameters that are affecting this, because I
 don't want to end up with an application that kills the battery.

 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] RelativeLayout with vertical center positioning problem

2009-05-06 Thread elDoudou

Hello.

I've been fighting for hours now, and still do not understand what I'm
missing. Sorry for posting only text, since I cannot attach an image
to this post.

I have an activity which uses an XML layout made of a top-level
RelativeLayout composed of 3 TextViews (see the XML at the end of the
post):

 - the first one (id=leftText, =green) with a green background is
intended to have its left border aligned with the left's of the screen
(i.e. on the left) and always visible, i.e. never pushed out of the
screen on the far left especially because of the second TextView (with
id=centralText) text length. Ideally, this TextView should be centered
vertically in its layout.
 - the third one (id=rightText, =blue) with a blue background is
intended to have its right border aligned with the right border of the
screen (i.e. on the right) and always be visible and not pushed out of
the screen on the far right (same remark as for the first TextView).
Ideally, this TextView should be centered vertically in its layout.
 - the second one (id=centralText, =red) with the red background is
intended to be between the first and third TextViews. It contains some
lenghty textual contents which spans multiple lines.

My problem is that I cannot manage the first (green) and third(blue)
TextViews to be centered vertically. I use the
android:layout_centerVertical=true attribute on both views on that
purpose, but this does not generate the expected right result: the two
TextViews seem to stretch the RelativeLayout height and are aligned to
the bottom of this layout. I get:


|  | red | |
|  | red | |
|  | red | |
|   |
 - 
| green |   | blue |


If I do not use this layout_centerVertical attribute, I get the
expected (which is not what I want):


| green | red | blue |
 - ---
|  | red ||
|  | red ||
---

I use the RelativeLayout because I want the blue (=third) TextView to
be on the right and always visible, whatever the length of the red
(=second) TextView. Hence, I need to declare it first in the
RelativeLayout. It seems that the RelativeLayout drawing does not take
properly into account the red TextView height in order to center
vertically the blue and green TextViews.

I am open to any suggestion to match my requirements and have the
following rendering:


|  | red | |
 - 
| green | red | blue |
 - ---
|  | red | |


Thank you so much for your time. Regards,
Édouard

Here is the standalone source code of the XML layout, so that you can
reproduce the problem:

?xml version=1.0 encoding=utf-8?
RelativeLayout
  xmlns:android=http://schemas.android.com/apk/res/android;
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:background=#ff0

  TextView
android:id=@+id/leftText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentLeft=true
android:layout_centerVertical=true
android:text=A left text
android:background=#0f0
  /
  TextView
android:id=@+id/rightText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentRight=true
android:layout_centerVertical=true
android:text=A right text
android:background=#00f
  /
  TextView
android:id=@+id/centralText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_toLeftOf=@id/rightText
android:layout_toRightOf=@id/leftText
android:text=Some central very long text which spans multiple
lines in order to demonstrate the problem: the green left and the
right blue texts should be centered vertically
android:background=#f00
  /
/RelativeLayout

--~--~-~--~~~---~--~~
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 1.5 SDK now available

2009-05-06 Thread icedfusion

I too am having this exact same problem. It seems to be related to
64bit versions of linux.
In terms of developing on linux, this release is a backward step - its
unusable.
I may have to revert back to the previous release, if that is indeed
an option.

ice.

On Apr 27, 8:41 pm, Javi javierjc1...@gmail.com wrote:
 I have problems with the new sdk (1.5),

 A dialog show with a error a and suggest me to exit the workbench.
 Other dialog appear with a pingUsageServer failed:
 Android SDK Ping
 pingUsageServer failed

 The .log file says:

 !SESSION 2009-04-27 21:31:38.570 
 ---
 eclipse.buildId=M20090211-1700
 java.version=1.6.0_13
 java.vendor=Sun Microsystems Inc.
 BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_ES
 Command-line arguments:  -os linux -ws gtk -arch x86_64

 !ENTRY com.android.ide.eclipse.adt 4 0 2009-04-27 21:31:46.358
 !MESSAGE Failed to load properties file for project 'WifiScan'

 !ENTRY com.android.ide.eclipse.adt 4 0 2009-04-27 21:31:48.330
 !MESSAGE pingUsageServer failed
 !STACK 0
 org.eclipse.swt.SWTError: Not implemented [multiple displays]
         at org.eclipse.swt.SWT.error(SWT.java:3803)
         at org.eclipse.swt.widgets.Display.checkDisplay(Display.java:712)
         at org.eclipse.swt.widgets.Display.create(Display.java:842)
         at org.eclipse.swt.graphics.Device.init(Device.java:154)
         at org.eclipse.swt.widgets.Display.init(Display.java:471)
         at org.eclipse.swt.widgets.Display.init(Display.java:462)
         at 
 com.android.sdkstats.SdkStatsService.getUserPermission(SdkStatsService.java:278)
         at com.android.sdkstats.SdkStatsService.ping(SdkStatsService.java:126)
         at 
 com.android.ide.eclipse.common.SdkStatsHelper.pingUsageServer(Unknown
 Source)
         at com.android.ide.eclipse.adt.AdtPlugin$12.run(Unknown Source)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 !ENTRY com.android.ide.eclipse.adt 4 0 2009-04-27 21:31:48.341
 !MESSAGE pingUsageServer failed
 !STACK 0
 org.eclipse.swt.SWTError: Not implemented [multiple displays]
         at org.eclipse.swt.SWT.error(SWT.java:3803)
         at org.eclipse.swt.widgets.Display.checkDisplay(Display.java:712)
         at org.eclipse.swt.widgets.Display.create(Display.java:842)
         at org.eclipse.swt.graphics.Device.init(Device.java:154)
         at org.eclipse.swt.widgets.Display.init(Display.java:471)
         at org.eclipse.swt.widgets.Display.init(Display.java:462)
         at 
 com.android.sdkstats.SdkStatsService.getUserPermission(SdkStatsService.java:278)
         at com.android.sdkstats.SdkStatsService.ping(SdkStatsService.java:126)
         at 
 com.android.ide.eclipse.common.SdkStatsHelper.pingUsageServer(Unknown
 Source)
         at com.android.ide.eclipse.adt.AdtPlugin$12.run(Unknown Source)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 I use the latest Ubuntu jaunty and Sun JDK
 The previous Android SDK  (1.1) works without problems

 I tried to do a clean installation of the eclipse and the sdk but the
 problem persist

 Anybody else with this problem?
 --
 Javier Jardón Cabezas
--~--~-~--~~~---~--~~
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: Launch Activity

2009-05-06 Thread danielececil...@gmail.com

Ok but i have problem with the startActivity method.

I created a class ScreenGet witch extends Actity and override
onCreated.

I write a function main to launch it :

-- Begin Code 

public class Main
 {
  public static void main(String[] args)
   {
Intent i = new Intent();
i.putExtra(title, titre);
i.putExtra(label, label);
i.putExtra(size, 12);
ScreenGet sg = new ScreenGet();
sg.startActivity(i);
   }
 }
-- End Code -



I supposed when I run it, it launch my activity , but i have got the
following error :




---
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:2923), pid=4668, tid=5032
#  Error: ShouldNotReachHere()
#
# Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-
x86)
# An error report file with more information is saved as:
# C:\Users\MXP\workspace\JythonroidFunctions\hs_err_pid4668.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
--

On May 6, 12:19 am, Mark Murphy mmur...@commonsware.com wrote:
 danielececil...@gmail.com wrote:
  Hi,

  I try to launch an Activity created with :

          public class MyActivity extends Activity { ... }

  from a java method.

  Somebody can help me please

 startActivity(new Intent(this, MyActivity.class));

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

 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
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: 'Take a picture' intent on 1.5 - anybody please? ;)

2009-05-06 Thread BoD

I'm really sorry to insist :) It's just that I didn't find a
definitive answer anywhere so I was really hoping somebody from Google
could quickly answer.

Is there another intent to use or a parameter to the
ACTION_IMAGE_CAPTURE one, to simply take a full-sized picture (should
be 2048x1536 on the adp1)?

I'd really like to know, because - correct me if I'm wrong - if the
answer is that it's not currently possible, I'm gonna have to
implement my own little 'Camera'-like app just to do that...

Thanks a lot.

BoD


On May 5, 12:24 am, BoD bodl...@gmail.com wrote:
 Anyone?

 Thanks for your help!

 BoD

 On May 4, 12:46 am, BoD bodl...@gmail.com wrote:

  Hi!

  Following this old 
  thread:http://groups.google.com/group/android-developers/browse_thread/threa...

  and this issue:http://code.google.com/p/android/issues/detail?id=1480

  I tried the following piece of code to take a picture on 1.5:

  private void takePic2() {
  final Intent imageCaptureIntent = new Intent
  (MediaStore.ACTION_IMAGE_CAPTURE);
  imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
  Uri.fromFile(new File(Environment
  .getExternalStorageDirectory(), test.jpg)));
  startActivityForResult(imageCaptureIntent, 1);
  }

  It works but the resulting image is 512x384 (on the ADP1).

  The doc says If the EXTRA_OUTPUT is not present, then a small sized
  image is returned as a Bitmap object in the extra field. If the
  EXTRA_OUTPUT is present, then the full-sized image will be written to
  the Uri value of EXTRA_OUTPUT.

  But 512x384 looks rather 'small-sized' to me!

  So what is the correct way to get the full-sized version?

  Thanks a lot for your help!

  BoD


--~--~-~--~~~---~--~~
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] Request for remote logs

2009-05-06 Thread chris

Hi , i just created this issue but since it's not clear if the issue
management is used or not , i'll put it again here
http://code.google.com/p/android/issues/detail?id=2589

What i find really frustrating is that our users seems unable to
report the issues they are having with any usefull informations.
Most of the time , all we have when we have something is a useless
Not working or Crashed comment.

What i would like to see is an automated crash report that would send
the RunTimexception  stacktrace to the market and a way for the
developpers to have acces to them.
This would give us some ideas of what going wrong with our
applications and let us fix it.(and give us an idea of how stable
really is our application on the Field.

Chris


--~--~-~--~~~---~--~~
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 add app to apps list

2009-05-06 Thread birdy

Hi all;

After build the cupcake, I can find many apps' .apk files in folder:
\out\target\product\generic\obj\APPS\xxx_intermediates. But only 12
apps put in apps list (alarclock, browser, calender, camcoder...
etc).
How can I add an app (ex. ApiDemos) to the app list and then I can run
it?
What is the purpose of xxx.apk.unaligned and xxx.apk.unsigned ?



--~--~-~--~~~---~--~~
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: onDraw() help

2009-05-06 Thread Sukitha Udugamasooriya

Is there a way to save the canvas object?
--~--~-~--~~~---~--~~
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] help: button.setBackgroundColor

2009-05-06 Thread Sukitha Udugamasooriya

HI,

After clling button.setBackgroundColor(int color)... the 3D look of
the button has gone... :(
How can I mend this??

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] How to capture key events from on screen keyboard?

2009-05-06 Thread Yan Shi

What I want to do is that when a normal key (such as A) is pressed
from the onscreen keyboard, I can be notified to do something just
like when that key is pressed from real keyboard. But it seems
EditText can not receive onKey event from onScreen keyboard.

How can I do that?

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: Questions on Tab (TabWidget) Width

2009-05-06 Thread Mark Murphy

Lewis Z. wrote:
 It seems to me that the current implemetaion of TabWidget is only good
 for four tabs, which is too few for any complicated applications.

Use other activities to avoid the need for so many tabs. Or, as the
previous poster suggested, roll your own tab-like system, perhaps using
a ViewFlipper.

 Another issue is the ListView widget. It's not a list view at all.

And your definition of list view is...what, exactly? It sure seems to
fit the definition of a list view from every GUI toolkit I've ever
used, and that stems back an awfully long time.

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

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~-~--~~~---~--~~
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: SharedPreferences got deleted! - What could be the problem?

2009-05-06 Thread Mark Murphy

so_is wrote:
 Well Mark the problem is that I am using the suggested way to save the
 settings. I do commit every single edit() like suggested. But a lot of
 users are still reporting that they lose settings. I don't know why
 but it happens some times. :( (I have worked with my app for 2 months
 now and have never lost the settings)

It will be difficult to fix the bug without a repeatable scenario.

 To sum up I don't like the suggestion using Sqlite because I would
 just ignore a bug which is obviously there but no one knows what it
 really is.

If you can come up with a repeatable scenario for the SharedPreferences
damage, post an issue to http://b.android.com with a project and
instructions for causing the problem.

Otherwise, if I were in your shoes, I would switch to some other means
(e.g., SQLite) of storing the data you are storing in SharedPreferences,
simply to make your users happy.

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

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~-~--~~~---~--~~
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] book page animation

2009-05-06 Thread zeeshan

Hi Experts,

i am wondering if i can animate my book app next page.

any helping link of page animation?
--~--~-~--~~~---~--~~
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: Launch Activity

2009-05-06 Thread Mark Murphy

danielececil...@gmail.com wrote:
 Ok but i have problem with the startActivity method.
 
 I created a class ScreenGet witch extends Actity and override
 onCreated.
 
 I write a function main to launch it :
 
 -- Begin Code 
 
 public class Main
  {
   public static void main(String[] args)
{
 Intent i = new Intent();
 i.putExtra(title, titre);
 i.putExtra(label, label);
 i.putExtra(size, 12);
 ScreenGet sg = new ScreenGet();
 sg.startActivity(i);
}
  }
 -- End Code -

This is not Android code. public static void main() is not an entry
point into an Android application.

 I supposed when I run it, it launch my activity , but i have got the
 following error :
 
 ---
 #
 # An unexpected error has been detected by Java Runtime Environment:
 #
 #  Internal Error (classFileParser.cpp:2923), pid=4668, tid=5032
 #  Error: ShouldNotReachHere()
 #
 # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-
 x86)
 # An error report file with more information is saved as:
 # C:\Users\MXP\workspace\JythonroidFunctions\hs_err_pid4668.log
 #
 # If you would like to submit a bug report, please visit:
 #   http://java.sun.com/webapps/bugreport/crash.jsp
 #
 --

This is not Android. This is desktop Java. There is no C:\ drive and no
Sun Java VM inside an Android device or emulator.

Have you worked through the online tutorials?

http://developer.android.com/guide/tutorials/hello-world.html
http://developer.android.com/guide/tutorials/notepad/index.html

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

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~-~--~~~---~--~~
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 capture key events from on screen keyboard?

2009-05-06 Thread Yan Shi

Still need help. I found there a flag in KeyEvent:
KeyEvent.FLAG_SOFTKEYBOARD. But how can I receive this keyevent? The
key listener I registered never received any key events from soft
keyboard.

On May 6, 6:40 pm, Yan Shi shiyansu...@gmail.com wrote:
 What I want to do is that when a normal key (such as A) is pressed
 from the onscreen keyboard, I can be notified to do something just
 like when that key is pressed from real keyboard. But it seems
 EditText can not receive onKey event from onScreen keyboard.

 How can I do that?

 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] Low Memory: No more background

2009-05-06 Thread balakrishna...@gmail.com

Hi,

I am working on openGles with seven images displayed on the screen. I
am translating the position of these seven images on a button click
so
it is drawing every time it seems.
But, after sometime all the images are getting disappeared then I've
checked in the logcat
I found this :ActivityManager(52): Low Memory: No more background
processes.

I heard animating bitmaps via OpenGL may give similar problems.

Any suggestions would be appreciated.


Thanks,
Bala



--~--~-~--~~~---~--~~
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] R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread gsmd

Ok, here's a simple 'helloorange' activity:
--
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText(some text);
tv.setBackgroundDrawable(getResources().getDrawable
(android.R.drawable.list_selector_background));
setContentView(tv);
}
--
When running this, the background doesn't change it's color. When I
change to android.R.drawable.btn_default, it works.
So, how do I apply orange background drawable to a TextView at
runtime?

TIA.
--~--~-~--~~~---~--~~
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] use long field in sqlite

2009-05-06 Thread Zeeshan Khan

Hi,

I want to store long value in database ( current time millis) ,
how to store it

Please reply soon. Thank you

Regards
zeeshan
--~--~-~--~~~---~--~~
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: use long field in sqlite

2009-05-06 Thread Mark Murphy

Zeeshan Khan wrote:
 Hi,
 
 I want to store long value in database ( current time millis) ,
 how to store it
 
 Please reply soon. Thank you

Use an INTEGER column, which will handle long values.

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

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~-~--~~~---~--~~
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] Text getting cut-off in a list view

2009-05-06 Thread Gyan
I have a list of text views in my screen. The text in one of the list item
gets cut-off on the right side. There is no padding attached in the layout
and there are no over-lapping layouts. But when i focus that particular list
item the text view is re-drawn and re-positioned to give me uncut text. This
happens inconsistently.

Is this an existing issue with the framework??

Thanks
Gyan

--~--~-~--~~~---~--~~
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] 3D transition flip between activities?

2009-05-06 Thread zeeshan

Hi experts,

i am wondering if i can flip 2 different views by 3D transition like
in iphone?
3D transition example in ApiDemo seems transition in the same activity
--~--~-~--~~~---~--~~
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] ALSA channels

2009-05-06 Thread l hx
when i use the code below.
status_t ALSAStreamOps::channelCount(int channels) {
int err;
if (!mHandle)
return NO_INIT;
err = snd_pcm_hw_params_set_channels(mHandle, mHardwareParams,
channels);
if (err  0) {
LOGE(Unable to set channel count to %i: %s,
channels, snd_strerror(err));
return BAD_VALUE;
}
LOGD(Using %i %s for %s.,
channels, channels == 1 ? channel : channels, streamName());
return NO_ERROR;
}

i want to set channel 1 when recoring audio. but the message of Unable to
set channel count to %i: %s will be print .who know why?

--~--~-~--~~~---~--~~
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] Unable to remove default launching of an application.

2009-05-06 Thread Guillaume Perrot

Example:
I have a button which starts an activity with GET_CONTENT audio/*
I have a menu with choices: Music Track or Sound Recorder and a
checkbox.
I check the box, it tells me that I can clear the setting in
Application - Manage Applications.
I launch the Music Track with the box checked.
I go to the application settings, but the clear defaults button is
always enabled.
It was already the case with 1.1 SDK, 1.5 does not help (tested on
emulator 1.5 AND ADP1 with 1.5 recovery image).

I also tested the allowClearUserData flag but it seems we cannot clear
anything but the cache (for the webview ?).
--~--~-~--~~~---~--~~
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: Unable to remove default launching of an application.

2009-05-06 Thread Guillaume Perrot

I go to the application settings, but the clear defaults button is
always enabled - I meant always disabled.

On 6 mai, 15:39, Guillaume Perrot guillaume.p...@gmail.com wrote:
 Example:
 I have a button which starts an activity with GET_CONTENT audio/*
 I have a menu with choices: Music Track or Sound Recorder and a
 checkbox.
 I check the box, it tells me that I can clear the setting in
 Application - Manage Applications.
 I launch the Music Track with the box checked.
 I go to the application settings, but the clear defaults button is
 always enabled.
 It was already the case with 1.1 SDK, 1.5 does not help (tested on
 emulator 1.5 AND ADP1 with 1.5 recovery image).

 I also tested the allowClearUserData flag but it seems we cannot clear
 anything but the cache (for the webview ?).
--~--~-~--~~~---~--~~
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: onDraw() help

2009-05-06 Thread Streets Of Boston

Nope.

Try this.
-Create a mutable bitmap the size of the screen. Save this bitmap as a
variable of your instance.
-Create a Canvas from this bitmap  (i think you can 'cache' it, save
this canvas as a variable of your instance).
-Draw your touches into this canvas.

Then in the 'onDraw(Canvas screenCanvas)' draw the mutable bitmap into
the screenCanvas.



On May 5, 3:35 pm, Moons moone...@gmail.com wrote:
 When you call View.invalidate(), your View refresh itself, wich means
 that all your previous draws are erased.

 On May 5, 8:41 am, Sukitha Udugamasooriya suk...@gmail.com wrote:



  Hi all,

  I'm relatively new to Android. I want to draw strokes on my screen when the
  user touches. Next stroke should be drawn from the end point of the previous
  stroke.
  This is my code. What happens here is just only the current stroke is drawn.
  Previous strokes are vanished? What is wrong here? Please help..

  package src.test;

  import android.app.Activity;
  import android.content.Context;
  import android.graphics.Bitmap;
  import android.graphics.Canvas;
  import android.graphics.Color;
  import android.graphics.Paint;
  import android.os.Bundle;
  import android.view.MotionEvent;
  import android.view.View;
  import android.view.View.OnTouchListener;

  public class ActDraw extends Activity implements OnTouchListener {

      float x = 200;
      float y = 200;
      float x1 = 10;
      float y1 = 45;
      float prvx = 150;
      float prvy = 150;
      MyView m;

      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);

          m = new MyView(this);
          m.setOnTouchListener(this);
          setContentView(m);

      }
      public boolean onTouch(View v, MotionEvent event) {
          switch (event.getAction()) {
          case MotionEvent.ACTION_DOWN: {
              prvx = x;
              prvy = y;
              x = event.getX();
              y = event.getY();
               m.invalidate();
          }
          }
          return false;
      }

      class MyView extends View {
          Paint p = new Paint();
          Bitmap bm;
          int i;

          public MyView(Context context) {
              super(context);

          }

          @Override
          protected void onDraw(Canvas canvas) {
              super.onDraw(canvas);
              p.setColor(Color.GREEN);
              p.setStrokeWidth(4);
              canvas.drawLine(prvx, prvy, x, y, p);
          }
      }

  }- 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: onDraw() help

2009-05-06 Thread Streets Of Boston

Nope.

Try this.
-Create a mutable bitmap the size of the screen. Save this bitmap as
a
variable of your instance.
-Create a Canvas from this bitmap  (i think you can 'cache' it, save
this canvas as a variable of your instance).
-Draw your touches into this canvas.


Then in the 'onDraw(Canvas screenCanvas)' draw the mutable bitmap
into
the screenCanvas.

On May 6, 6:24 am, Sukitha Udugamasooriya suk...@gmail.com wrote:
 Is there a way to save the canvas object?
--~--~-~--~~~---~--~~
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] DTD file for syntax checking of layouts / manifest files

2009-05-06 Thread a druid

Hi,


Some XML tools request DTD files in order to allow syntax checking.

Is there any place for official Android DTD files for the Manifest /
for the layout XML files?

If yes, Where could I find them?

If no: Wyy does Google / Android not provide them?

Thanks in advance for any answer clarification.



--~--~-~--~~~---~--~~
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] OnfocusChangeListener question

2009-05-06 Thread André Charles Legendre

I have one ItemizedOverlay in a 1.5 SDK application.
It is working good. I would like to be informed when the user point
(not tap) one Item.
I don't know if ItemizedOverlay.OnfocusChangeListener is the good tool
for that and how to use it.

Regards

Andre

--~--~-~--~~~---~--~~
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] Display image in marker

2009-05-06 Thread Wouter

Hey,

I want to display an image (loaded from an internet source) in a
marker in a MapView!
How can I do that?

Thx,

Wouter
--~--~-~--~~~---~--~~
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] Do application updates put your app back to the top of the list on the By Date tab in the android market?

2009-05-06 Thread jcook2004

I have an app on the android market and when I release an update, the
application does *not* goto the top of the app list on the by date
tab. But I notice that this isnt the case for all apps - infact just
today I noticed an app that was published months ago but updated w/ to
a new version appearing on the top of the list. What gives? Is there
some special process devs have to do to get their app update to the
top of the list on the By Date tab? Are they unpublishing/republishing
their app at every version update? Spill the beans :)


Thanks!

JC
--~--~-~--~~~---~--~~
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] Issue with activities

2009-05-06 Thread Tushar

Hi,
I writing a small application on android 1.1 . This application when
launched from application menu starts with Activity1 . Using some UI
Activity1 launches Activity2 which finally launches Activity3 after
some user action.
When Press Home button and relaunch my application Activity1 get
launched.
But now if try to launch Activity2 , instead of Activity2 , Activity3
comes to foreground with old state.  Now if I go back to Activity1 by
pressing back button and then try to launch Activity2 it works fine.

What could be reason of Activity3 coming in to foreground instead of
Activity2 in second scenario ?

I have set Activity1 's launch mode as singleInstance, where as
Activity2/Activity3 are using default settings.

Regards,

Tushar
--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-06 Thread Satya Komatineni

What about function keys? Is it possible to tie together a set of
function keys (if they exist) to a service or an activity that is in
the background?

On Tue, May 5, 2009 at 6:19 PM, Mark Murphy mmur...@commonsware.com wrote:

 Taísa Cristina wrote:
 In fact I do need to handle key strokes.

 Find another UI pattern.

 It would be easier if I could
 handle home key, so that I could prevent the user from going to home
 screen.

 Find another UI pattern. Prevent the user from going to home screen is
 fairly evil and is a tactic I would expect to find from malware.

 And it would be very boring for the user to go back to
 the Activity whenever he wanted to press a key and make stuff...

 Find another UI pattern.

 Is there a way to register for receiving key strokes if my application
 is compiled with the emulator/device image? (should I ask it on
 android-platform?)

 A list on http://source.android.com/discuss is a better place for
 questions about modifying firmware.

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

 Android App Developer Books: http://commonsware.com/books.html

 


--~--~-~--~~~---~--~~
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: use long field in sqlite

2009-05-06 Thread Zeeshan Khan
Thanks Mark  for your reply,
 i will try what you told,
 For the timing i have stored it in Text field . but will change if
above works
Regards,
Zeeshan

On Wed, May 6, 2009 at 6:41 PM, Mark Murphy mmur...@commonsware.com wrote:


 Zeeshan Khan wrote:
  Hi,
 
  I want to store long value in database ( current time millis) ,
  how to store it
 
  Please reply soon. Thank you

 Use an INTEGER column, which will handle long values.

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

 _The Busy Coder's Guide to Android Development_ Version 2.0 Available!

 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-06 Thread Mark Murphy

Satya Komatineni wrote:
 What about function keys? Is it possible to tie together a set of
 function keys (if they exist) to a service or an activity that is in
 the background?

You can be notified when select dedicated hardware keys are pressed:

ACTION_CAMERA_BUTTON
ACTION_MEDIA_BUTTON

http://developer.android.com/reference/android/content/Intent.html

Bear in mind that those keys are probably being put to other uses (e.g.,
activating the camera).

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

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
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 Latitude/Longitude informations of an image

2009-05-06 Thread Georg

Okay I could fix this problem.
I changed to the new SDK, now it works without any problem. Perhaps
it's a bug in the old SDK:

Regards Georg

On Apr 27, 5:06 pm, Georg georgk...@gmail.com wrote:
 Hi,

 I'm trying to retrieve Latitude/Longitude informations of an image,
 but I always get 0.0 for lat/lon.
 But I know the image has this information inside, because I tried it
 with exiftools. When I use exiftools I can see the lat/lon values.

 My Source:
 startActivity:
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setType(image/*);
    startActivityForResult(intent, 1);

 and onActivtiyResult
                 Uri photoUri = data.getData();
                 ContentResolver cr = getContentResolver();
                 Cursor cursor = cr.query(photoUri, new String[] {
                                 MediaStore.Images.ImageColumns.DATA,
                                 MediaStore.Images.ImageColumns.LATITUDE,
                                 MediaStore.Images.ImageColumns.LONGITUDE }, 
 null, null, null);
                 cursor.moveToFirst();

                 int fnamecol = cursor.getColumnIndexOrThrow
 (Images.ImageColumns.DATA);
                 int latcol = cursor.getColumnIndexOrThrow
 (Images.ImageColumns.LATITUDE);
                 int loncol = cursor
                                 
 .getColumnIndexOrThrow(Images.ImageColumns.LONGITUDE);

                 String fname = cursor.getString(fnamecol);
                 Float lat = cursor.getFloat(latcol);
                 Float lon = cursor.getFloat(loncol);

 This should work, because I get the filename,  or is this a total
 wrong approach?

 Regards Georg
--~--~-~--~~~---~--~~
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] Marker Info Window

2009-05-06 Thread Wouter

Hey,

How can I make such a info bubble like you see at this image

http://www.lifeaware.net/images/screenshots/locatefriend.png

I'm looking for it for very long!

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] How to implement a button in a widget

2009-05-06 Thread 6real

Dear all,

I try to create a widget and I am now wondering how to be able to put
a button on my widget and set its onClickListener.

It seems that we are limited to the RemoteViews... OK I can deal with
that (but this is a limitat to me) but I'd like to add a button where
the user can request an update on the data displayed in the widget. (I
get some info on the web but the user only needs to request an update,
I can't defined an automatique update, it's useless for my app)

I'm sure we can do that since there is an example with a player and
obviously with a PLAY/PAUSE button.

I was looking for in the remoteViews API btu without finding
anything...

Can you please give me the direction where to find the way of doing...
Thanks a lot for your 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: Questions on Tab (TabWidget) Width

2009-05-06 Thread Lewis Z.

Mark, thanks for the idea. I also implemented a similar stuff like
your ViewFlipper for other OS.

A list view can be as simple as one column list but can be as
complicate as a spreadsheet. I think a good widget should be easily
extensible/expansible. For example, the options menu is well thought.
You can limit the menu to six items. But when one needs more, it
automatically gives you an expanded menu. This is a little bit off my
original topic.


On May 6, 5:52 am, Mark Murphy mmur...@commonsware.com wrote:
 Lewis Z. wrote:
  It seems to me that the current implemetaion of TabWidget is only good
  for four tabs, which is too few for any complicated applications.

 Use other activities to avoid the need for so many tabs. Or, as the
 previous poster suggested, roll your own tab-like system, perhaps using
 a ViewFlipper.

  Another issue is the ListView widget. It's not a list view at all.

 And your definition of list view is...what, exactly? It sure seems to
 fit the definition of a list view from every GUI toolkit I've ever
 used, and that stems back an awfully long time.

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

 Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
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] TextView Hanging Indent?

2009-05-06 Thread nEx.Software

Is there a way to do like a hanging-indent in the standard TextvView?
Basically, I have an image that I am trying not to overlap, but I want
the text to be as close as possible to that image. I think a hanging
indent would be perfect for this but am not sure that this is possible
in the standard textview. I'm using this in an AppWidget, which is why
I am insisting on a standard TextView. Any ideas? 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] How to re-do the incoming phone app

2009-05-06 Thread dashman

How would one re-do the application that displays the
incoming phone number.

I assume it's a content provider or a service that can
be replaced.

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: How to capture key events from on screen keyboard?

2009-05-06 Thread Yan Shi

Still need help...

On May 6, 7:53 pm, Yan Shi shiyansu...@gmail.com wrote:
 Still need help. I found there a flag in KeyEvent:
 KeyEvent.FLAG_SOFTKEYBOARD. But how can I receive this keyevent? The
 key listener I registered never received any key events from soft
 keyboard.

 On May 6, 6:40 pm, Yan Shi shiyansu...@gmail.com wrote:





  What I want to do is that when a normal key (such as A) is pressed
  from the onscreen keyboard, I can be notified to do something just
  like when that key is pressed from real keyboard. But it seems
  EditText can not receive onKey event from onScreen keyboard.

  How can I do that?

  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: ALSA channels

2009-05-06 Thread Marco Nelissen
This group is for developing using the SDK. You might want to ask your
question in the android-porting group instead.


On Wed, May 6, 2009 at 6:31 AM, l hx lihongxia8...@gmail.com wrote:

 when i use the code below.
 status_t ALSAStreamOps::channelCount(int channels) {
 int err;
 if (!mHandle)
 return NO_INIT;
 err = snd_pcm_hw_params_set_channels(mHandle, mHardwareParams,
 channels);
 if (err  0) {
 LOGE(Unable to set channel count to %i: %s,
 channels, snd_strerror(err));
 return BAD_VALUE;
 }
 LOGD(Using %i %s for %s.,
 channels, channels == 1 ? channel : channels, streamName());
 return NO_ERROR;
 }

 i want to set channel 1 when recoring audio. but the message of Unable to
 set channel count to %i: %s will be print .who know why?

 


--~--~-~--~~~---~--~~
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 1.5 - crash during drawing of multiline TextView

2009-05-06 Thread Mike

I have a problem with Android 1.5 (problem that didn't appear in 1.1
and earlier):

This TextView is in RelativeLayout:
TextView android:id=@+id/list_item_name
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Some Text
android:textColor=@color/black
android:layout_toRightOf=@id/list_item_marker
android:layout_marginLeft=8dip
android:layout_marginTop=5dip
android:textSize=@dimen/ts_item_top
android:paddingRight=70dip
/

Layout is filled and used inside ListView programmatically.

Whenever I have text that should be wrapped to multiple lines, this
exception raises:
05-06 14:44:19.465: ERROR/ActivityThread(1009): Failed to find
provider info for com.google.settings
05-06 14:44:22.330: ERROR/AndroidRuntime(1009): Uncaught handler:
thread main exiting due to uncaught exception
05-06 14:44:22.360: ERROR/AndroidRuntime(1009):
java.lang.StackOverflowError
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.TextView.onDraw(TextView.java:3921)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5838)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.AbsListView.dispatchDraw(AbsListView.java:1319)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.ListView.dispatchDraw(ListView.java:2820)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5944)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.AbsListView.draw(AbsListView.java:2121)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5944)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5841)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5841)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.view.View.draw(View.java:5841)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
05-06 14:44:22.360: ERROR/AndroidRuntime(1009): at

[android-developers] Does SimpleDateFormat no longer throw a ParseException?

2009-05-06 Thread EboMike

In an 1.5 environment, it seems like SimpleDateFormat.parse() no
longer throws an exception if it can't parse the string - it simply
returns null. Did that change?
--~--~-~--~~~---~--~~
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 1.5 - crash during drawing of multiline TextView

2009-05-06 Thread Mark Murphy

Mike wrote:
 I have a problem with Android 1.5 (problem that didn't appear in 1.1
 and earlier):
 
 This TextView is in RelativeLayout:
 TextView android:id=@+id/list_item_name
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=Some Text
   android:textColor=@color/black
   android:layout_toRightOf=@id/list_item_marker
   android:layout_marginLeft=8dip
   android:layout_marginTop=5dip
   android:textSize=@dimen/ts_item_top
   android:paddingRight=70dip
   /
 
 Layout is filled and used inside ListView programmatically.
 
 Whenever I have text that should be wrapped to multiple lines, this
 exception raises:

snip

 05-06 14:44:22.360: ERROR/AndroidRuntime(1009):
 java.lang.StackOverflowError

How deep and complicated is your view hierarchy? With Android 1.5, I get
the sense that StackOverflowError will be triggered by a too-complex set
of views, particularly in terms of depth. You can use hierarchyviewer
(in the tools/ of your SDK) to see how many layers you have -- if you're
in double digits on the deepest branch, you might need to find ways to
simplify the UI.

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

Android App Developer Training: http://commonsware.com/training.html

--~--~-~--~~~---~--~~
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: Update application from the Android Market

2009-05-06 Thread David C

so how could you explain me that people that updated their app don't
have new feature until reboot of the phone... sorry guys...

i faced the same problem with different application updates...
(Meridian, Android Fortunes. etc)

David

On May 6, 9:10 am, Dianne Hackborn hack...@android.com wrote:
 You are wrong, when installing an update all processes of the current
 version are killed.  You can test this yourself by doing adb install -r
 path-to-apk



 On Tue, May 5, 2009 at 3:30 AM, David C dcampi...@gmail.com wrote:

  Hi,

  After different testing, I found an issue with the update method
  when installing an application update.

  I developped DilbertDroid, and a lot of people are saying that there
  is missing some functionnality but the latest version published on the
  market have this functionnalities.

  I suppose that when updating a application, the updater doesn't kill
  the process related to the application but only update the application
  files on phone. Result: the old application is still running until you
  kill the process or reboot the system.

  I think it is not very professionnal to tell user to deinstall and
  then reboot their phone in order to install an update.

  David

  PS: My application doesn't have any service running

 --
 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, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
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] signed 1.5 does not work.. probs with 1.5

2009-05-06 Thread guruk

hi,
i have quit a strange problem.

my app developed on sdk 1.1 was fine to install on g1 1.1
- direct from eclipse run
- as exported unsigned
- as the .apk from the /bin

now i developing it on sdk 1.5
- works direct from eclipse run
- DOES NOT install the exported unsigned
- DOES NOT install the exported signed (not prob while signing)
- only install the .apk from the /bin

when i try to manual sign the .apk from the /bin i get a zip error
from jarsigner.

whats going on.. anyone can help?

thanks
chris

--~--~-~--~~~---~--~~
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 1.5 - crash during drawing of multiline TextView

2009-05-06 Thread Romain Guy

 How deep and complicated is your view hierarchy? With Android 1.5, I get
 the sense that StackOverflowError will be triggered by a too-complex set
 of views, particularly in terms of depth. You can use hierarchyviewer
 (in the tools/ of your SDK) to see how many layers you have -- if you're
 in double digits on the deepest branch, you might need to find ways to
 simplify the UI.

It was already the case in 1.0 and 1.1 but because of new features
added in Cupcake, StackOverflowException now happen a bit earlier.
This means that the app was almost overflowing anyway.

-- 
Romain Guy
Android framework engineer
romain...@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

--~--~-~--~~~---~--~~
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: DTD file for syntax checking of layouts / manifest files

2009-05-06 Thread Romain Guy

There is no DTD for the layout files because they use dynamic tag
names. A DTD cannot be written.

On Wed, May 6, 2009 at 6:53 AM, a druid klausf...@gmail.com wrote:

 Hi,


 Some XML tools request DTD files in order to allow syntax checking.

 Is there any place for official Android DTD files for the Manifest /
 for the layout XML files?

 If yes, Where could I find them?

 If no: Wyy does Google / Android not provide them?

 Thanks in advance for any answer clarification.



 




-- 
Romain Guy
Android framework engineer
romain...@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

--~--~-~--~~~---~--~~
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: help: button.setBackgroundColor

2009-05-06 Thread Romain Guy

Don't call setBackgroundColor(). It simply replaces the button's
background with a solid color. If you want to keep the button look but
give it a new set of colors, you will have to grab the original assets
from the source code and modify them in a graphics editing tool.
Alternatively you can play with ColorFilters.

On Wed, May 6, 2009 at 3:35 AM, Sukitha Udugamasooriya suk...@gmail.com wrote:

 HI,

 After clling button.setBackgroundColor(int color)... the 3D look of
 the button has gone... :(
 How can I mend this??

 Thanks in advance
 




-- 
Romain Guy
Android framework engineer
romain...@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

--~--~-~--~~~---~--~~
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: OnfocusChangeListener question

2009-05-06 Thread André Charles Legendre

Hi I finally succeed to use ItemizedOverlay.OnfocusChangeListener in
my Map Overlay but it onFocusChanged is called only when I click in
one Item (in same time that OnTap do it) bu not when I point one Item.

The only difference is that OnFocusChanged is call even if I click
outside one Item (I get a null Item in that case)

Is it normal ?

Regards

Andre Legendre

On Wed, May 6, 2009 at 4:53 PM, André Charles Legendre
andre.legen...@gmail.com wrote:
 I have one ItemizedOverlay in a 1.5 SDK application.
 It is working good. I would like to be informed when the user point
 (not tap) one Item.
 I don't know if ItemizedOverlay.OnfocusChangeListener is the good tool
 for that and how to use it.

 Regards

 Andre


--~--~-~--~~~---~--~~
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] Video with MediaRecorder

2009-05-06 Thread Anders Nilsson Plymoth
Hi,

Does anyone know how to use the MediaRecorder to API to capture video?

I am writing an application where I want to be able to capture video. I am
trying to use the MediaRecorder API in 1.5, which is supposed to support
video capture. However, there are no examples in the documentation on how to
use this API for video (only for audio, and that works perfect). Basically
what I do is the following:

final MediaRecorder recorder = new MediaRecorder();
final String filePath;



recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
recorder.setOutputFile(filePath);
recorder.prepare();
recorder.start();

This gives me the following error:
E/CameraInput(   37): No surface is available for display
E/MediaRecorder( 7609): prepare failed: -2147483648

OK, so I have to have a surface to preview the video? Could be useful I
guess, but not something I really need.

Could I use the VideoView widget for this, or is that only for playback?

Or am I supposed to use a SurfaceView to preview the video? I saw someone
use that to capture images, but they used android.hardware.Camera to open
the camera and capture a frame, and did not use MediaRecorder.

Does anyone have any idea on how to capture video, or even better have some
example code?

Thanks,
Anders

--~--~-~--~~~---~--~~
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: signed 1.5 does not work.. probs with 1.5

2009-05-06 Thread guruk

also when I bring the source i developed on sdk 1.5 to my sdk 1.1 and
compile there
no error.. but i can not install the /bin .apk  not the exported
unsigned and even not the exported signed.


--~--~-~--~~~---~--~~
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 implement a button in a widget

2009-05-06 Thread Jeff Sharkey

Sure, this is easy to do.  If you have a Button in your target layout
passed to new RemoteViews(), you can call
RemoteViews.setOnClickPendingIntent() to trigger firing of the given
PendingIntent when people click on your button.  You could also use
any View, not just Button.

Here's how the Music widget is connecting up its buttons:

http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/MediaAppWidgetProvider.java;hb=cupcake#l161

j

On Wed, May 6, 2009 at 7:38 AM, 6real xirgon...@gmail.com wrote:

 Dear all,

 I try to create a widget and I am now wondering how to be able to put
 a button on my widget and set its onClickListener.

 It seems that we are limited to the RemoteViews... OK I can deal with
 that (but this is a limitat to me) but I'd like to add a button where
 the user can request an update on the data displayed in the widget. (I
 get some info on the web but the user only needs to request an update,
 I can't defined an automatique update, it's useless for my app)

 I'm sure we can do that since there is an example with a player and
 obviously with a PLAY/PAUSE button.

 I was looking for in the remoteViews API btu without finding
 anything...

 Can you please give me the direction where to find the way of doing...
 Thanks a lot for your help
 




-- 
Jeff Sharkey
jshar...@google.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] Re: R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread Jeff Sharkey

So the list_selector_drawable is a stateful drawable, where it's
default state is black.  (This is why ListView unselected items are
transparent/black.)  The default button drawable is also stateful, but
it's default state is an unpressed button.

You could force it into a focused state using Drawable.setState()
before setting it to the background.

However, keep in mind that you probably don't want to have the
TextView always appear selected, as it might confuse users to see two
selected areas on screen at once.

You might instead try setting the TextView to be focusable, so the
background changes automatically whenever the user moves focus to the
TextView.

j

On Wed, May 6, 2009 at 5:57 AM, gsmd gsm...@gmail.com wrote:

 Ok, here's a simple 'helloorange' activity:
 --
   �...@override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText(some text);
        tv.setBackgroundDrawable(getResources().getDrawable
 (android.R.drawable.list_selector_background));
        setContentView(tv);
    }
 --
 When running this, the background doesn't change it's color. When I
 change to android.R.drawable.btn_default, it works.
 So, how do I apply orange background drawable to a TextView at
 runtime?

 TIA.
 




-- 
Jeff Sharkey
jshar...@google.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] Re: signed 1.5 does not work.. probs with 1.5

2009-05-06 Thread guruk

shit.. and now when i compile it from my sdk 1.5 and make run from
eclipse
i also get an
Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE
[2009-05-06 19:07:49 - My Days 07] Please check logcat output for more
details.
[2009-05-06 19:07:49 - My Days 07] Launch canceled!

so what !!.. now I really need some help. its a standart G1 mobile
with 1.1 software rc 33
and not a developer phone.. so what to do ???

on many questions i did not get an answer in this forum.. now i hope
someone can help.


thanks
chris

--~--~-~--~~~---~--~~
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: 'Take a picture' intent on 1.5 - anybody please? ;)

2009-05-06 Thread bra...@gmail.com

Bod - as far as I know there is no intent just to snap a picture. What
you can do is call the camera intent to start the camera app itself
and use that to take your image then use the last URI it generated as
the source for whatever you want.

On May 6, 6:03 am, BoD bodl...@gmail.com wrote:
 I'm really sorry to insist :) It's just that I didn't find a
 definitive answer anywhere so I was really hoping somebody from Google
 could quickly answer.

 Is there another intent to use or a parameter to the
 ACTION_IMAGE_CAPTURE one, to simply take a full-sized picture (should
 be 2048x1536 on the adp1)?

 I'd really like to know, because - correct me if I'm wrong - if the
 answer is that it's not currently possible, I'm gonna have to
 implement my own little 'Camera'-like app just to do that...

 Thanks a lot.

 BoD

 On May 5, 12:24 am, BoD bodl...@gmail.com wrote:

  Anyone?

  Thanks for your help!

  BoD

  On May 4, 12:46 am, BoD bodl...@gmail.com wrote:

   Hi!

   Following this old 
   thread:http://groups.google.com/group/android-developers/browse_thread/threa...

   and this issue:http://code.google.com/p/android/issues/detail?id=1480

   I tried the following piece of code to take a picture on 1.5:

       private void takePic2() {
           final Intent imageCaptureIntent = new Intent
   (MediaStore.ACTION_IMAGE_CAPTURE);
           imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
   Uri.fromFile(new File(Environment
                   .getExternalStorageDirectory(), test.jpg)));
           startActivityForResult(imageCaptureIntent, 1);
       }

   It works but the resulting image is 512x384 (on the ADP1).

   The doc says If the EXTRA_OUTPUT is not present, then a small sized
   image is returned as a Bitmap object in the extra field. If the
   EXTRA_OUTPUT is present, then the full-sized image will be written to
   the Uri value of EXTRA_OUTPUT.

   But 512x384 looks rather 'small-sized' to me!

   So what is the correct way to get the full-sized version?

   Thanks a lot for your help!

   BoD


--~--~-~--~~~---~--~~
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: R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread Romain Guy

It's default state is transparent actually :)

On Wed, May 6, 2009 at 9:10 AM, Jeff Sharkey jshar...@android.com wrote:

 So the list_selector_drawable is a stateful drawable, where it's
 default state is black.  (This is why ListView unselected items are
 transparent/black.)  The default button drawable is also stateful, but
 it's default state is an unpressed button.

 You could force it into a focused state using Drawable.setState()
 before setting it to the background.

 However, keep in mind that you probably don't want to have the
 TextView always appear selected, as it might confuse users to see two
 selected areas on screen at once.

 You might instead try setting the TextView to be focusable, so the
 background changes automatically whenever the user moves focus to the
 TextView.

 j

 On Wed, May 6, 2009 at 5:57 AM, gsmd gsm...@gmail.com wrote:

 Ok, here's a simple 'helloorange' activity:
 --
   �...@override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText(some text);
        tv.setBackgroundDrawable(getResources().getDrawable
 (android.R.drawable.list_selector_background));
        setContentView(tv);
    }
 --
 When running this, the background doesn't change it's color. When I
 change to android.R.drawable.btn_default, it works.
 So, how do I apply orange background drawable to a TextView at
 runtime?

 TIA.
 




 --
 Jeff Sharkey
 jshar...@google.com

 




-- 
Romain Guy
Android framework engineer
romain...@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

--~--~-~--~~~---~--~~
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: OnfocusChangeListener question

2009-05-06 Thread André Charles Legendre

Finally I found a solution.
Thank you for your help.

Andre

On Wed, May 6, 2009 at 6:43 PM, André Charles Legendre
andre.legen...@gmail.com wrote:
 Hi I finally succeed to use ItemizedOverlay.OnfocusChangeListener in
 my Map Overlay but it onFocusChanged is called only when I click in
 one Item (in same time that OnTap do it) bu not when I point one Item.

 The only difference is that OnFocusChanged is call even if I click
 outside one Item (I get a null Item in that case)

 Is it normal ?

 Regards

 Andre Legendre

 On Wed, May 6, 2009 at 4:53 PM, André Charles Legendre
 andre.legen...@gmail.com wrote:
 I have one ItemizedOverlay in a 1.5 SDK application.
 It is working good. I would like to be informed when the user point
 (not tap) one Item.
 I don't know if ItemizedOverlay.OnfocusChangeListener is the good tool
 for that and how to use it.

 Regards

 Andre



--~--~-~--~~~---~--~~
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: 'Take a picture' intent on 1.5 - anybody please? ;)

2009-05-06 Thread BoD

Thanks a lot for your answer!
Well I'm guessing this means I have to instruct the user to press the
back button after they took the picture (to go back to my own
activity), which is not ideal...

It's too bad cause the ACTION_IMAGE_CAPTURE one is exactly what I want
- except the result image is low res :(

Thanks

BoD



On May 6, 6:17 pm, bra...@gmail.com peacoc...@gmail.com wrote:
 Bod - as far as I know there is no intent just to snap a picture. What
 you can do is call the camera intent to start the camera app itself
 and use that to take your image then use the last URI it generated as
 the source for whatever you want.

 On May 6, 6:03 am, BoD bodl...@gmail.com wrote:

  I'm really sorry to insist :) It's just that I didn't find a
  definitive answer anywhere so I was really hoping somebody from Google
  could quickly answer.

  Is there another intent to use or a parameter to the
  ACTION_IMAGE_CAPTURE one, to simply take a full-sized picture (should
  be 2048x1536 on the adp1)?

  I'd really like to know, because - correct me if I'm wrong - if the
  answer is that it's not currently possible, I'm gonna have to
  implement my own little 'Camera'-like app just to do that...

  Thanks a lot.

  BoD

  On May 5, 12:24 am, BoD bodl...@gmail.com wrote:

   Anyone?

   Thanks for your help!

   BoD

   On May 4, 12:46 am, BoD bodl...@gmail.com wrote:

Hi!

Following this old 
thread:http://groups.google.com/group/android-developers/browse_thread/threa...

and this issue:http://code.google.com/p/android/issues/detail?id=1480

I tried the following piece of code to take a picture on 1.5:

    private void takePic2() {
        final Intent imageCaptureIntent = new Intent
(MediaStore.ACTION_IMAGE_CAPTURE);
        imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(new File(Environment
                .getExternalStorageDirectory(), test.jpg)));
        startActivityForResult(imageCaptureIntent, 1);
    }

It works but the resulting image is 512x384 (on the ADP1).

The doc says If the EXTRA_OUTPUT is not present, then a small sized
image is returned as a Bitmap object in the extra field. If the
EXTRA_OUTPUT is present, then the full-sized image will be written to
the Uri value of EXTRA_OUTPUT.

But 512x384 looks rather 'small-sized' to me!

So what is the correct way to get the full-sized version?

Thanks a lot for your help!

BoD


--~--~-~--~~~---~--~~
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: signed 1.5 does not work.. probs with 1.5

2009-05-06 Thread guruk

thanks, but i targeted already in eclipse to 1.1 (api 2) why you say
level one ? api 3 is 1.5 and google apis as i see.
now i was able to install my old app,, deinstalled from the app
manager and now i can
compile again from eclipse and it runs on my 1.1 g1

now.. tripple Check:

delete /bin/app.apk

1. run app in eclipse, copy /bin/app.apk to my g1 1.1  WORK
(file: 97.520 bytes)
delete app.apk from g1
2. export app.apk unsigned, install on g1 1.1  ... NOT POSSIBLE TO
INSTALL  (file: 94.388 bytes (why smaller???)
3. export app.apk signed, install on g1 1.1  WORK  (file: 97.629
bytes)

any ideas??

chris

--~--~-~--~~~---~--~~
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] iPhone like Tab Widget

2009-05-06 Thread Yash Patel
Hi,

Please anyone know how to create iphone like Tab widget (in the bottom of
the screen).

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] MP3 to PCM 16 Bit

2009-05-06 Thread Vimae

With the new 1.5 now finally being released, I'm trying to give my app
a second go.

I currently have a service where you can stream your music library
from the web. However, each stream has to be authenticated with a
cookie or the server returns a 500 error, so the standard MediaPlayer
will not work, because I cannot pass a cookie with the Uri!

I noticed that the API now has an AudioTrack class within
android.media. It can take a raw stream of PCM 16 BIT. I was wondering
if anyone has any tips or ideas on progmatically transcoding MP3
stream to PCM 16 for playing through.

--~--~-~--~~~---~--~~
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: MP3 to PCM 16 Bit

2009-05-06 Thread Marco Nelissen
On Wed, May 6, 2009 at 10:19 AM, Vimae mi...@vimae.com wrote:


 With the new 1.5 now finally being released, I'm trying to give my app
 a second go.

 I currently have a service where you can stream your music library
 from the web. However, each stream has to be authenticated with a
 cookie or the server returns a 500 error, so the standard MediaPlayer
 will not work, because I cannot pass a cookie with the Uri!


You could have a local proxy in your app that does that for you.

I noticed that the API now has an AudioTrack class within
 android.media. It can take a raw stream of PCM 16 BIT. I was wondering
 if anyone has any tips or ideas on progmatically transcoding MP3
 stream to PCM 16 for playing through.


You would have to find an mp3 decoder to include in your app.
Using one written in Java would perform poorly, and using a native
one would require writing some JNI code and passing data back
and forth. The proxy approach might be easier.

--~--~-~--~~~---~--~~
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: signed 1.5 does not work.. probs with 1.5

2009-05-06 Thread Raphael

On Wed, May 6, 2009 at 9:58 AM, guruk ilovesi...@gmail.com wrote:

 thanks, but i targeted already in eclipse to 1.1 (api 2) why you say
 level one ? api 3 is 1.5 and google apis as i see.

He said -t 1 which means target platform number 1. In the SDK the
first platform is API 2. Yeah a bit confusing, I agree.

 now i was able to install my old app,, deinstalled from the app
 manager and now i can
 compile again from eclipse and it runs on my 1.1 g1

 now.. tripple Check:

 delete /bin/app.apk

 1. run app in eclipse, copy /bin/app.apk to my g1 1.1  WORK
 (file: 97.520 bytes)
    delete app.apk from g1
 2. export app.apk unsigned, install on g1 1.1  ... NOT POSSIBLE TO
 INSTALL  (file: 94.388 bytes (why smaller???)
 3. export app.apk signed, install on g1 1.1  WORK  (file: 97.629
 bytes)

The install process cannot change the signing key of an app.

If you push an apk with a debug key (which is what happens when you
run from eclipse), you cannot install a signed apk directly. You need
to uninstall the debug version first. Works the other way too: if you
install a signed apk, you cannot install a debug version from eclipse.

You cannot push a non-signed apk at all iirc. It has to be signed
either by the eclipse/ant debug key or by you manually.

HTH
R/

--~--~-~--~~~---~--~~
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: MP3 to PCM 16 Bit

2009-05-06 Thread miles

I really can't believe I never thought of using a local proxy. It
seems all so simple now!
As I understand the concept, but not the actual implementation, would
you know of any tutorials or sample apps that go about the same lines
that I could look into?


On May 6, 10:29 am, Marco Nelissen marc...@android.com wrote:
 On Wed, May 6, 2009 at 10:19 AM, Vimae mi...@vimae.com wrote:

  With the new 1.5 now finally being released, I'm trying to give my app
  a second go.

  I currently have a service where you can stream your music library
  from the web. However, each stream has to be authenticated with a
  cookie or the server returns a 500 error, so the standard MediaPlayer
  will not work, because I cannot pass a cookie with the Uri!

 You could have a local proxy in your app that does that for you.

 I noticed that the API now has an AudioTrack class within

  android.media. It can take a raw stream of PCM 16 BIT. I was wondering
  if anyone has any tips or ideas on progmatically transcoding MP3
  stream to PCM 16 for playing through.

 You would have to find an mp3 decoder to include in your app.
 Using one written in Java would perform poorly, and using a native
 one would require writing some JNI code and passing data back
 and forth. The proxy approach might be easier.
--~--~-~--~~~---~--~~
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: R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread alex

Thanks, Jeff.
When user selects a TextView it 'slips' (which is indicated by
background color change) and the user is expected to select(tap)
another view then. Not every tap should lead to the first view losing
'focus'. That's the motivation behind setting background drawable
programmatically.
Back to the question.
--
Drawable bg = getResources().getDrawable
(android.R.drawable.list_selector_background);
bg.setState(new int[]{android.R.attr.state_pressed,
android.R.attr.state_focused});
tv.setBackgroundDrawable(bg);
--
This (and any of those attributes set alone) doesn't change anything.
Do I still get it wrong?

On May 6, 7:10 pm, Jeff Sharkey jshar...@android.com wrote:
 So the list_selector_drawable is a stateful drawable, where it's
 default state is black.  (This is why ListView unselected items are
 transparent/black.)  The default button drawable is also stateful, but
 it's default state is an unpressed button.

 You could force it into a focused state using Drawable.setState()
 before setting it to the background.

 However, keep in mind that you probably don't want to have the
 TextView always appear selected, as it might confuse users to see two
 selected areas on screen at once.

 You might instead try setting the TextView to be focusable, so the
 background changes automatically whenever the user moves focus to the
 TextView.

 j



 On Wed, May 6, 2009 at 5:57 AM, gsmd gsm...@gmail.com wrote:

  Ok, here's a simple 'helloorange' activity:
  --
    �...@override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         TextView tv = new TextView(this);
         tv.setText(some text);
         tv.setBackgroundDrawable(getResources().getDrawable
  (android.R.drawable.list_selector_background));
         setContentView(tv);
     }
  --
  When running this, the background doesn't change it's color. When I
  change to android.R.drawable.btn_default, it works.
  So, how do I apply orange background drawable to a TextView at
  runtime?

  TIA.

 --
 Jeff Sharkey
 jshar...@google.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] Re: R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread alex

Slightly off-topic, but thanks for the 'Drawable mutations' blog post
anyways. :)

On May 6, 7:18 pm, Romain Guy romain...@google.com wrote:
 It's default state is transparent actually :)



 On Wed, May 6, 2009 at 9:10 AM, Jeff Sharkey jshar...@android.com wrote:

  So the list_selector_drawable is a stateful drawable, where it's
  default state is black.  (This is why ListView unselected items are
  transparent/black.)  The default button drawable is also stateful, but
  it's default state is an unpressed button.

  You could force it into a focused state using Drawable.setState()
  before setting it to the background.

  However, keep in mind that you probably don't want to have the
  TextView always appear selected, as it might confuse users to see two
  selected areas on screen at once.

  You might instead try setting the TextView to be focusable, so the
  background changes automatically whenever the user moves focus to the
  TextView.

  j

  On Wed, May 6, 2009 at 5:57 AM, gsmd gsm...@gmail.com wrote:

  Ok, here's a simple 'helloorange' activity:
  --
    �...@override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         TextView tv = new TextView(this);
         tv.setText(some text);
         tv.setBackgroundDrawable(getResources().getDrawable
  (android.R.drawable.list_selector_background));
         setContentView(tv);
     }
  --
  When running this, the background doesn't change it's color. When I
  change to android.R.drawable.btn_default, it works.
  So, how do I apply orange background drawable to a TextView at
  runtime?

  TIA.

  --
  Jeff Sharkey
  jshar...@google.com

 --
 Romain Guy
 Android framework engineer
 romain...@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
--~--~-~--~~~---~--~~
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: Video with MediaRecorder

2009-05-06 Thread Dave Sparks

You need to call setPreviewDisplay() and pass in a SurfaceView before
you call prepare().

On May 6, 8:45 am, Anders Nilsson Plymoth lanils...@gmail.com wrote:
 Hi,

 Does anyone know how to use the MediaRecorder to API to capture video?

 I am writing an application where I want to be able to capture video. I am
 trying to use the MediaRecorder API in 1.5, which is supposed to support
 video capture. However, there are no examples in the documentation on how to
 use this API for video (only for audio, and that works perfect). Basically
 what I do is the following:

 final MediaRecorder recorder = new MediaRecorder();
 final String filePath;

 

 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
 recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
 recorder.setOutputFile(filePath);
 recorder.prepare();
 recorder.start();

 This gives me the following error:
 E/CameraInput(   37): No surface is available for display
 E/MediaRecorder( 7609): prepare failed: -2147483648

 OK, so I have to have a surface to preview the video? Could be useful I
 guess, but not something I really need.

 Could I use the VideoView widget for this, or is that only for playback?

 Or am I supposed to use a SurfaceView to preview the video? I saw someone
 use that to capture images, but they used android.hardware.Camera to open
 the camera and capture a frame, and did not use MediaRecorder.

 Does anyone have any idea on how to capture video, or even better have some
 example code?

 Thanks,
 Anders
--~--~-~--~~~---~--~~
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 re-do the incoming phone app

2009-05-06 Thread Yusuf T. Mobile

The incoming call screen is currently not customizeable, sorry.



Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




On May 6, 7:51 am, dashman erjdri...@gmail.com wrote:
 How would one re-do the application that displays the
 incoming phone number.

 I assume it's a content provider or a service that can
 be replaced.

 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 1.5 SDK now available

2009-05-06 Thread Roderick Kennedy

No reply to my question so far, here is the error I get in full:

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\.\Android\Toolsandroid create avd -t 1 -n android1.1
Exception in thread main java.lang.NullPointerException
at java.util.Collections$UnmodifiableMap.init(Unknown
Source)
at java.util.Collections.unmodifiableMap(Unknown Source)
at com.android.sdklib.avd.AvdManager$AvdInfo.init
(AvdManager.java:196)

at com.android.sdklib.avd.AvdManager.parseAvdInfo
(AvdManager.java:981)
at com.android.sdklib.avd.AvdManager.buildAvdList
(AvdManager.java:896)
at com.android.sdklib.avd.AvdManager.init(AvdManager.java:
310)
at com.android.sdkmanager.Main.createAvd(Main.java:512)
at com.android.sdkmanager.Main.doAction(Main.java:207)
at com.android.sdkmanager.Main.run(Main.java:83)
at com.android.sdkmanager.Main.main(Main.java:72)

I am using Windows Vista Ultimate, SP 1, with the latest Java. I
installed 1.5 after using the 1.5 preview, though I did of course
follow the instructions re. uninstalling the existing ADT.
--~--~-~--~~~---~--~~
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: ListView checked state wrongly shared between 2 views when reorienting screen

2009-05-06 Thread Toph

Yes they do, but is that wrong? I thought it was ok to have multiple
views with the same id.  They are part of 2 different activities that
share a common layout.


On Apr 27, 10:17 pm, Romain Guy romain...@google.com wrote:
 Your two list views probably have the same id.



 On Sat, Apr 25, 2009 at 11:00 AM, Chris clo...@gmail.com wrote:

  Hi,

  I have TabActivity that uses 2 other ListActivities for the tabs.
  Both underlying ListViews are set to CHOICE_MODE_MULTIPLE.
  When I run the following sequence of events, I get a strange result:
  1) Setup one activity (tab) and its ListView using a CursorAdapter,
  including checking some items on the list
  2)Reorientthescreen(openthekeyboard)
  3) Setup the second activity (tab) and its ListView using a
  CursorAdapter, including checking some items on the list
  4) Switch back to the first tab

  At this point, I can see in Eclipse that although (of course) each
  ListView is a distinct object, the internal variable used to store the
  checked state of items, called mCheckStates, is the SAME OBJECT
  REFERENCE in each of the ListViews.

  Clearly this is an issue, since the two views should not share the
  checked state of items between them.

  If I skip step #2, this does not occur

  Here is a bit more detail:
  After Step 1: ListView1 is object reference @1, ListView1.mCheckStates
  is object reference @2
  After Step 2: ListView1 is object reference @3, ListView1.mCheckStates
  is object reference @4 (the reorientation recreates the views)
  After Step 3: ListView2 is object reference @5, ListView1.mCheckStates
  is object reference @2 -- note the reuse of this reference from step
  #1, not sure how/why
  After Step 4: ListView1 is object reference @3 (unchanged),
  ListView1.mCheckStates is object reference @2 (changed) -- same as
  ListView2.mCheckStates

  Please help

  Thanks

 --
 Romain Guy
 Android framework engineer
 romain...@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
--~--~-~--~~~---~--~~
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: R.drawable.list_selector_background doesn't yield in orange

2009-05-06 Thread Jeff Sharkey

 When user selects a TextView it 'slips' (which is indicated by
 background color change) and the user is expected to select(tap)
 another view then. Not every tap should lead to the first view losing
 'focus'. That's the motivation behind setting background drawable
 programmatically.

Ouch, this is actually more of a touch mode question.  When the device
goes into touch mode, there isn't a visible concept of focus in
ListViews (when you scroll the list, any highlighted item reverts
back).

You might be looking for android:focusableInTouchMode, but this isn't
used many places on the platform.


-- 
Jeff Sharkey
jshar...@google.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] Activity state on pressing Back and Home button on the screen

2009-05-06 Thread karthikr


Hi Guys,

Whenever I press the home button when Im in the root task of my
application and when I click on the icon of my app again the state of
my task (activity) is retained, but when i press the back button on
the emulator and when I open my application its state is not retained.
I want the state to be retained in both the scenarios.

In the mnifest I have given the below entries,

android:alwaysRetainTaskState=true  for the root activity

android:launchMode=singleTask for the application

Regards,
R.Karthik
--~--~-~--~~~---~--~~
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: Activity state on pressing Back and Home button on the screen

2009-05-06 Thread Mark Murphy

karthikr wrote:
 Whenever I press the home button when Im in the root task of my
 application and when I click on the icon of my app again the state of
 my task (activity) is retained, but when i press the back button on
 the emulator and when I open my application its state is not retained.

The back button means close up this activity, and so state is not
supposed to be retained.

 I want the state to be retained in both the scenarios.

Implement onDestroy() and persist your state to a flat file or SQLite
database or something.

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

Android App Developer Training: http://commonsware.com/training.html

--~--~-~--~~~---~--~~
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: ListView checked state wrongly shared between 2 views when reorienting screen

2009-05-06 Thread Toph

Ok that prompts a few questions:
1) Can you elaborate on your last sentence: But that's true within an
activity only.  Are you saying that the identifier is the id plus the
activity? I have 2 different activities (on 2 tabs, actually).

2) How do you share a layout and use it multiple times, then?  If the
id is set in XML, and you have multiple instances, won't they save and
restore state incorrectly, then?

3) What about the items within a ListView?  Don't the all have the
same id(s)? Wouldn't this cause a problem when saving their state? Or
does the ListView do something magic to prevent such a problem?

On May 7, 1:54 am, Romain Guy romain...@google.com wrote:
 It's ok except when you need the views to save theirstate. The id is
 what identifies views when theirstateis saved so the toolkit simply
 think that your two list views are the same. But that's true within an
 activity only.



 On Wed, May 6, 2009 at 11:44 AM, Toph clo...@gmail.com wrote:

  Yes they do, but is that wrong? I thought it was ok to have multiple
  views with the same id.  They are part of 2 different activities that
  share a common layout.

  On Apr 27, 10:17 pm, Romain Guy romain...@google.com wrote:
  Your two list views probably have the same id.

  On Sat, Apr 25, 2009 at 11:00 AM, Chris clo...@gmail.com wrote:

   Hi,

   I have TabActivity that uses 2 other ListActivities for the tabs.
   Both underlying ListViews are set to CHOICE_MODE_MULTIPLE.
   When I run the following sequence of events, I get a strange result:
   1) Setup one activity (tab) and itsListViewusing a CursorAdapter,
   including checking some items on the list
   2)Reorientthescreen(openthekeyboard)
   3) Setup the second activity (tab) and itsListViewusing a
   CursorAdapter, including checking some items on the list
   4) Switch back to the first tab

   At this point, I can see in Eclipse that although (of course) each
  ListViewis a distinct object, the internal variable used to store the
  checkedstateof items, called mCheckStates, is the SAME OBJECT
   REFERENCE in each of the ListViews.

   Clearly this is an issue, since the two views should not share the
  checkedstateof items between them.

   If I skip step #2, this does not occur

   Here is a bit more detail:
   After Step 1: ListView1 is object reference @1, ListView1.mCheckStates
   is object reference @2
   After Step 2: ListView1 is object reference @3, ListView1.mCheckStates
   is object reference @4 (the reorientation recreates the views)
   After Step 3: ListView2 is object reference @5, ListView1.mCheckStates
   is object reference @2 -- note the reuse of this reference from step
   #1, not sure how/why
   After Step 4: ListView1 is object reference @3 (unchanged),
   ListView1.mCheckStates is object reference @2 (changed) -- same as
   ListView2.mCheckStates

   Please help

   Thanks

  --
  Romain Guy
  Android framework engineer
  romain...@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

 --
 Romain Guy
 Android framework engineer
 romain...@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
--~--~-~--~~~---~--~~
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] Copy My Location Functionality efficiently?

2009-05-06 Thread Hunter Peress

Hi. I'm looking to do a single location update as efficiently as
possible, currently, I'm doing:

requestLocationUpdates (getBestProvider(criteria, true), 0,0,
listener);

and then in the callback:
onLocationChanged(Location) {
  removeUpdates (listener)
}

The idea is to do 1 high priority location request, then immediately
end updates. Anyone see any downfalls with 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: How to get current date ??

2009-05-06 Thread fadden

On May 5, 5:31 pm, Daehoon Jeon jeondaeh...@gmail.com wrote:
 Thanks for help, but I already completely done, I think Android is different
 from Java about get current date.

In what way?

--~--~-~--~~~---~--~~
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   3   >