[android-developers] Re: sqlite can't show chinese words

2009-09-09 Thread 楊健

I have try to store japanese and it works well.But the logcat can't show
Japanese correctly,maybe you just test under eclipse, did you?

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of tstanly
Sent: Thursday, September 10, 2009 3:44 PM
To: Android Developers
Subject: [android-developers] sqlite can't show chinese words


hi all,

I found that sqlite can't store chinese words and will shows random
code in
the application when retrieve data.

can somebody give some help?

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] sqlite can't show chinese words

2009-09-09 Thread tstanly

hi all,

I found that sqlite can't store chinese words and will shows random
code in
the application when retrieve data.

can somebody give some help?

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: Tut (SDK 1.5) Get google account of user

2009-09-09 Thread kostmo

I have been investigating whether GoogleLoginService can substitute
for ClientLogin (see 
http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html)
on Google App Engine.

To use ClientLogin, I solicit the username and password from the user
in a dialog and exchange them on the Google server (https://
www.google.com/accounts/ClientLogin) for a 203-character string called
"Auth".  This "Auth" string can then be exchanged for a cookie on the
application server (http://myapp.appspot.com/_ah/login?auth=...).  The
"Value" of this obtained cookie is a 460-character string.  The cookie
can be used from then on to maintain the user session.

I was able to obtain the "authtoken", aka "SID", using the
GoogleLoginService method described in this thread.  The "authtoken"
obtained through this method also happened to be 203 characters.

I was hoping that the "authtoken" might be substituted for the "Auth"
string in the ClientLogin process, thus bypassing the need to solicit
the username/password.  Sadly, this appears not to be the case.
ClientLogin returns a "500" Server Error rather than the "204" I
usually get with a good login.

So unless anyone out there is aware to the contrary, my conclusion is
that you must prompt the user for their password if you want an
authenticated App Engine session.
--~--~-~--~~~---~--~~
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: Native code is being called successfully but not executed properly

2009-09-09 Thread pink 444



Hai,
I am newbie to Android ,Hence can you explain it in detail .


Thanks in Advance,
-Siva.

On Sep 10, 11:02 am, Dianne Hackborn  wrote:
> Hi, you are more likely to get help on android-ndk.
>
>
>
> On Wed, Sep 9, 2009 at 9:36 PM, pink 444  wrote:
>
> > hai folks,
>
> >In Android , Native code is written as follows.
>
> > JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject
> > obj)
> > {
> >  printf("THIS IS TEST");
> > }
>
> > JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
> > {
> >JNIEnv *env;
> >JNINativeMethod meth;
> >jclass k;
> >jint r;
>
> >r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
> >k = (*env)->FindClass (env, "com.android.Test.show");
>
> >meth.name = "show";
> >meth.signature = "()V";
> >meth.fnPtr = Java_com.android.Test.show;
> >r = (*env)->RegisterNatives (env, k, &meth, 1);
> >return JNI_VERSION_1_4;
>
> > }
>
> > JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved)
> > {
> >JNIEnv *env;
> >jclass k;
> >jint r;
> >r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
> >k = (*env)->FindClass (env, "com.android.Test.show");
> >(*env)->UnregisterNatives(env, k);
>
> > }
>
> > While executing on Android the following messages are obeserved in adb
> > logcat.
>
> > JNI (  524): Trying to load jni .so
> > I/System.out(  524): /system/lib
> > D/dalvikvm(  524): Trying to load lib /data/libjnilibs.so 0x433f22d0
> > D/dalvikvm(  524): Added shared lib /data/libjnilibs.so 0x433f22d0
> > I/ActivityManager(   50): Displayed activity
> > com.android.helloactivity
>
> > But "THIS IS TEST" is not being displayed, which is displayed in
> > native code.
>
> > There are no errors regarding loading shared library and calling
> > native code.Then why is the message is not displayed in logging.
>
> > Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not
> > implemented i am getting errors in Logging.If i do as above i not
> > getting that native code message.
>
> > Any help would be appreciated highly.
>
> > Regards,
> > -Siva.
>
> --
> 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: Multiple data for an intent

2009-09-09 Thread Dexter's Brain

Thanks Dianne,
That, I guess answers my question.

Dexter.

On Sep 10, 10:59 am, Dianne Hackborn  wrote:
> Any application you are going to send multiple pieces of data to would need
> to be written to explicitly support it -- it's not like maps is magically
> going to do anything sane with multiple geo URIs even if there was a way to
> get them to it.
>
> Intent supports one data field.  I doubt this will change.
>
> In Eclair I believe there will be a new intent protocol for sharing multiple
> data items, but it puts that data in the bundle, and applications must
> explicitly support it.
>
> On Wed, Sep 9, 2009 at 10:44 PM, Dexter's Brain wrote:
>
>
>
>
>
> > But, I don't have control over the target application. Suppose, I want
> > to send 3 geo points info to the google maps application, will this
> > solve my problem?
>
> > Thanks,
> > Dexter.
>
> > On Sep 10, 10:20 am, AJ  wrote:
> > > You could put all data in Bundle and send this Bundle with the Intent.
> > > This will solve your problem.
>
> > > Thanks,
> > > AJ
>
> > > On Sep 10, 10:02 am, "Dexter's Brain" 
> > > wrote:
>
> > > > Hi All,
>
> > > > I was just wondering if it is possible to give the intent a set of
> > > > data, instead of just one. A particular scenario where this could be
> > > > applicable would be a music application.
>
> > > > You select a list of songs, and pass all these data (file path) to the
> > > > Music Player's application.
>
> > > > Another scenario: You need to plot more than one address on the Google
> > > > Maps. You launch the application with a set of data for the intent.
>
> > > > Is this possible??
>
> > > > Thanks,
> > > > Dexter.
>
> --
> 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: Native code is being called successfully but not executed properly

2009-09-09 Thread Dianne Hackborn
Hi, you are more likely to get help on android-ndk.

On Wed, Sep 9, 2009 at 9:36 PM, pink 444  wrote:

>
> hai folks,
>
>In Android , Native code is written as follows.
>
> JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject
> obj)
> {
>  printf("THIS IS TEST");
> }
>
> JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
> {
>JNIEnv *env;
>JNINativeMethod meth;
>jclass k;
>jint r;
>
>r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
>k = (*env)->FindClass (env, "com.android.Test.show");
>
>
>meth.name = "show";
>meth.signature = "()V";
>meth.fnPtr = Java_com.android.Test.show;
>r = (*env)->RegisterNatives (env, k, &meth, 1);
>return JNI_VERSION_1_4;
>
>
>
> }
>
>
> JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved)
> {
>JNIEnv *env;
>jclass k;
>jint r;
>r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
>k = (*env)->FindClass (env, "com.android.Test.show");
>(*env)->UnregisterNatives(env, k);
>
>
> }
>
>
> While executing on Android the following messages are obeserved in adb
> logcat.
>
> JNI (  524): Trying to load jni .so
> I/System.out(  524): /system/lib
> D/dalvikvm(  524): Trying to load lib /data/libjnilibs.so 0x433f22d0
> D/dalvikvm(  524): Added shared lib /data/libjnilibs.so 0x433f22d0
> I/ActivityManager(   50): Displayed activity
> com.android.helloactivity
>
> But "THIS IS TEST" is not being displayed, which is displayed in
> native code.
>
> There are no errors regarding loading shared library and calling
> native code.Then why is the message is not displayed in logging.
>
> Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not
> implemented i am getting errors in Logging.If i do as above i not
> getting that native code message.
>
>
> Any help would be appreciated highly.
>
> Regards,
> -Siva.
> >
>


-- 
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: Content Provider VS SQLiteDatabase

2009-09-09 Thread Dianne Hackborn
Content provider is (generally) built on top of SQLite.  You don't pick one
or the other.

On Wed, Sep 9, 2009 at 9:24 PM, Chris  wrote:

>
> I would like to know the exact difference between Content provider and
> SQLiteDatabase. If we have to share our data among applications then
> we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY
> difference, OR using Content Provider has something to do with
> performence???
> Any input will be highly appreciated.
>
> 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] Re: Multiple data for an intent

2009-09-09 Thread Dianne Hackborn
Any application you are going to send multiple pieces of data to would need
to be written to explicitly support it -- it's not like maps is magically
going to do anything sane with multiple geo URIs even if there was a way to
get them to it.

Intent supports one data field.  I doubt this will change.

In Eclair I believe there will be a new intent protocol for sharing multiple
data items, but it puts that data in the bundle, and applications must
explicitly support it.

On Wed, Sep 9, 2009 at 10:44 PM, Dexter's Brain wrote:

>
> But, I don't have control over the target application. Suppose, I want
> to send 3 geo points info to the google maps application, will this
> solve my problem?
>
> Thanks,
> Dexter.
>
> On Sep 10, 10:20 am, AJ  wrote:
> > You could put all data in Bundle and send this Bundle with the Intent.
> > This will solve your problem.
> >
> > Thanks,
> > AJ
> >
> > On Sep 10, 10:02 am, "Dexter's Brain" 
> > wrote:
> >
> > > Hi All,
> >
> > > I was just wondering if it is possible to give the intent a set of
> > > data, instead of just one. A particular scenario where this could be
> > > applicable would be a music application.
> >
> > > You select a list of songs, and pass all these data (file path) to the
> > > Music Player's application.
> >
> > > Another scenario: You need to plot more than one address on the Google
> > > Maps. You launch the application with a set of data for the intent.
> >
> > > Is this possible??
> >
> > > Thanks,
> > > Dexter.
> >
> >
> >
>


-- 
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: Supported Media Formats Programmatically

2009-09-09 Thread kk

Hi Ajeet,

Thanks for the reply.

This is great information, but unfortunately does not address my
question.

I am not certain that querying the Webkit interface gurantees that the
mimetype is support on across the platform, let alone via Webkit based
applications.

Documentation to sparse to determine.

Regards,

KK


On Sep 9, 5:37 pm, Ajeet Singh  wrote:
> See the class MimeTypeMap.java (frameworks\base\core\java\android
> \webkit)
>
> Hope this helps you.
>
> AJ
>
>
>
> kk wrote:
> > How do I determine programmatically which Media MimeTypes/Formats are
> > supported on a specific device/platform?
>
> > There doesn't appear to be any methods in Media Store or Media
> > Managers to determine supported types on device.
>
> > Is this by design or can we expect to see support in future releases?
>
> > Regards,
>
> > KK
--~--~-~--~~~---~--~~
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: Security framework available on android??

2009-09-09 Thread Roman ( T-Mobile USA)

The Bouncy Castle framework is part of Android. You can find it in
the  dalvik/libcore. If you want to use bouncy castle on SDK level you
can download a jar package from http://www.bouncycastle.org/

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·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 Sep 9, 9:46 pm, Sudeep Jha  wrote:
> Which security framework is available or can be ported to
> android ?
>
> Warm Regards,
> Sudeep
--~--~-~--~~~---~--~~
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: Multiple data for an intent

2009-09-09 Thread Dexter's Brain

But, I don't have control over the target application. Suppose, I want
to send 3 geo points info to the google maps application, will this
solve my problem?

Thanks,
Dexter.

On Sep 10, 10:20 am, AJ  wrote:
> You could put all data in Bundle and send this Bundle with the Intent.
> This will solve your problem.
>
> Thanks,
> AJ
>
> On Sep 10, 10:02 am, "Dexter's Brain" 
> wrote:
>
> > Hi All,
>
> > I was just wondering if it is possible to give the intent a set of
> > data, instead of just one. A particular scenario where this could be
> > applicable would be a music application.
>
> > You select a list of songs, and pass all these data (file path) to the
> > Music Player's application.
>
> > Another scenario: You need to plot more than one address on the Google
> > Maps. You launch the application with a set of data for the intent.
>
> > Is this possible??
>
> > Thanks,
> > Dexter.
>
>
--~--~-~--~~~---~--~~
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] Is there any method to read sms and gmail?

2009-09-09 Thread 楊健

Hey everybody!

Is there any method to read sms and gmail?
It seems there is not any  provider to read sms and gmail.
But in Manifest.permission  I found "READ_SMS"(Allows an application
to read SMS messages.).
The android.telephony.gsm.SmsManager class allow us to sent a sms but
read.
If possible I want to read sms and gmail.

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: Multiple data for an intent

2009-09-09 Thread AJ

You could put all data in Bundle and send this Bundle with the Intent.
This will solve your problem.

Thanks,
AJ

On Sep 10, 10:02 am, "Dexter's Brain" 
wrote:
> Hi All,
>
> I was just wondering if it is possible to give the intent a set of
> data, instead of just one. A particular scenario where this could be
> applicable would be a music application.
>
> You select a list of songs, and pass all these data (file path) to the
> Music Player's application.
>
> Another scenario: You need to plot more than one address on the Google
> Maps. You launch the application with a set of data for the intent.
>
> Is this possible??
>
> Thanks,
> Dexter.
--~--~-~--~~~---~--~~
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] Multiple data for an intent

2009-09-09 Thread Dexter's Brain

Hi All,

I was just wondering if it is possible to give the intent a set of
data, instead of just one. A particular scenario where this could be
applicable would be a music application.

You select a list of songs, and pass all these data (file path) to the
Music Player's application.

Another scenario: You need to plot more than one address on the Google
Maps. You launch the application with a set of data for the intent.

Is this possible??

Thanks,
Dexter.
--~--~-~--~~~---~--~~
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] Security framework available on android??

2009-09-09 Thread Sudeep Jha
Which security framework is available or can be ported to
android ?

Warm Regards,
Sudeep

--~--~-~--~~~---~--~~
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] Native code is being called successfully but not executed properly

2009-09-09 Thread pink 444

hai folks,

In Android , Native code is written as follows.

JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject
obj)
{
  printf("THIS IS TEST");
}

JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
JNIEnv *env;
JNINativeMethod meth;
jclass k;
jint r;

r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
k = (*env)->FindClass (env, "com.android.Test.show");


meth.name = "show";
meth.signature = "()V";
meth.fnPtr = Java_com.android.Test.show;
r = (*env)->RegisterNatives (env, k, &meth, 1);
return JNI_VERSION_1_4;



}


JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved)
{
JNIEnv *env;
jclass k;
jint r;
r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4);
k = (*env)->FindClass (env, "com.android.Test.show");
(*env)->UnregisterNatives(env, k);


}


While executing on Android the following messages are obeserved in adb
logcat.

JNI (  524): Trying to load jni .so
I/System.out(  524): /system/lib
D/dalvikvm(  524): Trying to load lib /data/libjnilibs.so 0x433f22d0
D/dalvikvm(  524): Added shared lib /data/libjnilibs.so 0x433f22d0
I/ActivityManager(   50): Displayed activity
com.android.helloactivity

But "THIS IS TEST" is not being displayed, which is displayed in
native code.

There are no errors regarding loading shared library and calling
native code.Then why is the message is not displayed in logging.

Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not
implemented i am getting errors in Logging.If i do as above i not
getting that native code message.


Any help would be appreciated highly.

Regards,
-Siva.
--~--~-~--~~~---~--~~
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] Content Provider VS SQLiteDatabase

2009-09-09 Thread Chris

I would like to know the exact difference between Content provider and
SQLiteDatabase. If we have to share our data among applications then
we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY
difference, OR using Content Provider has something to do with
performence???
Any input will be highly appreciated.

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 do real-time monitor the state of SD card

2009-09-09 Thread jerry

my quetion is from switching "usb connected" in the phone
notifications,which pop up from taskbar.
try to all the ACTION_MEDIA_* series of Intent actions,but these are
all failed.these actions couldn't real-time monitor the state of SD
card.
also, use broadcast receivers,the code like this, but it's still not
dynamic mounted or unmounted:
@Override
public void onResume()
{
 super.onResume();

 IntentFilter filter = new IntentFilter();
 filter.addAction(Intent.ACTION_UMS_CONNECTED);//try all the
other ACTION_MEDIA_* series of Intent actions,and these are also
unsuccessed.
 registerReceiver( mBroadcastReceiver, filter );
}

@Override
public void onPause()
{
  super.onPause();

  unregisterReceiver( mBroadcastReceiver  );
}

private BroadcastReceiver mBroadcastReceiver  = new BroadcastReceiver
()
{
 @Override
 public void onReceive(Context context, Intent intent)
{
  updateSDcardStatus();
}
};

private void updateSDcardStatus()
{
 Log.i(TAG, "other status: " + status );
}
can you give me a demo,and you can success to mount the state of SD
card

On Sep 10, 1:07 am, Mark Murphy  wrote:
> jerry wrote:
> > I want to know the state of SD card is dynamic mounted or not mounted?
> > it's very kind of you if you can give me a demo(for example, use api
> > registerReceiver、BroadcastReceiver、onReceive and so on).
>
> Look at the ACTION_MEDIA_* series of Intent actions:
>
> http://developer.android.com/intl/zh-CN/reference/android/content/Int...
>
> For examples of using broadcast receivers, both those registered in the
> manifest or those using registerReceiver(), I have some examples from my
> Advanced Android book up on github:
>
> http://github.com/commonsguy/cw-advandroid/tree/e50e087577f8b28e72735...
>
> --
> 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: how do real-time monitor the state of SD card

2009-09-09 Thread jerry

my quetion is from switching "usb connected" in the phone
notifications,which pop up from taskbar.
try to all the ACTION_MEDIA_* series of Intent actions,but these are
all failed.these actions couldn't real-time monitor the state of SD
card.
also, use broadcast receivers,the code like this, but it's still not
dynamic mounted or unmounted:
@Override
public void onResume()
{
 super.onResume();

 IntentFilter filter = new IntentFilter();
 filter.addAction(Intent.ACTION_UMS_CONNECTED);//try all the
other ACTION_MEDIA_* series of Intent actions,and these are also
unsuccessed.
 registerReceiver( mBroadcastReceiver, filter );
}

@Override
public void onPause()
{
  super.onPause();

  unregisterReceiver( mBroadcastReceiver  );
}

private BroadcastReceiver mBroadcastReceiver  = new BroadcastReceiver
()
{
 @Override
 public void onReceive(Context context, Intent intent)
{
  updateSDcardStatus();
}
};

private void updateSDcardStatus()
{
 Log.i(TAG, "other status: " + status );
}
can you give me a demo,and you can success to mount the state of SD
card

On Sep 10, 1:07 am, Mark Murphy  wrote:
> jerry wrote:
> > I want to know the state of SD card is dynamic mounted or not mounted?
> > it's very kind of you if you can give me a demo(for example, use api
> > registerReceiver、BroadcastReceiver、onReceive and so on).
>
> Look at the ACTION_MEDIA_* series of Intent actions:
>
> http://developer.android.com/intl/zh-CN/reference/android/content/Int...
>
> For examples of using broadcast receivers, both those registered in the
> manifest or those using registerReceiver(), I have some examples from my
> Advanced Android book up on github:
>
> http://github.com/commonsguy/cw-advandroid/tree/e50e087577f8b28e72735...
>
> --
> 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: Play audio over an active phone call, so other end can hear it

2009-09-09 Thread Dianne Hackborn
You can't do this on the G1 class hardware.  This audio routing is handled
by the baseband, which is a separate CPU running the radio and other related
things.

On Thu, Aug 20, 2009 at 8:39 AM, tcp  wrote:

>
> jsdf -
>
> Did you find an answer to this question somewhere?
>
> It is related to one of my own which is, can I write my own phone app?
>
> It would seem odd if there was no _possible_ programmatic interface to
> the audio streams (which would also preclude what I'm trying to do)
> because, even if the audio codecs are on the CPU (which I believe is
> the case in G1/ADP-land) somehow those data need to get to/from
> speakers/mics which are programmatically accessible.
>
> I'm poking around in com.android.internal.telephony for my stuff and
> will be trying some tests in the coming week or so.  I'll post
> anything of interest here.
>
> All comments are welcome.
>
> Thanks,
> - tcp
>
>
> On Aug 8, 7:45 am, jsdf  wrote:
> > Marco,
> > Just to clarify,
> > The sticking points could be:
> > 1.) hardware design doesn't support it
> > 2.) framework software that integrates Android onto specific phones
> > doesn't allow it
> > 3.) Android doesn't support it
> >
> > I definitely see #3 as true.  Does your comment below indicate #1, #2,
> > or both #1 and #2 are true?
> > Thanks for the help,
> > jsdf
> >
> > On Aug 7, 1:24 pm, Marco Nelissen  wrote:
> >
> > > The hardware doesn't support it. The closest you can get is by playing
> > > it over the speaker at full volume, so the microphone will pick it up.
> >
> > > On Fri, Aug 7, 2009 at 9:26 AM,jsdf wrote:
> >
> > > > Hi everyone,
> >
> > > > Is it possible to playaudioover an activephonecall, so the other
> > > > end can hear it?
> >
> > > > For example:
> > > > A and B are talking on thephone.
> > > > A presses a button that pullsaudiofrom a resource and plays it over
> > > > thephonecallto B.
> >
> > > > If so, what libraries should I look into?
> >
> > > > If not, is this something that could become accessible on rooted
> > > > phones? (Of course, only other rooted phones would be able to use the
> > > > application then...)
> >
> > > > Thanks,
> > > >jsdf
> >
>


-- 
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: change framework assets with alternate home screen

2009-09-09 Thread Dianne Hackborn
Correct, no way.

On Wed, Sep 9, 2009 at 7:15 PM, Andy Droid  wrote:

> Thanks for the reply.  So once the system.img is flashed to the phone,
> there is really no way to change the contents of framework-res.apk?  Sorry
> for the redundant question, just verifying.
>
> And no way to change out a core app icon, such as Contacts?
>
> thanks
>
>
>
>
> On Wed, Sep 9, 2009 at 3:58 PM, Romain Guy  wrote:
>
>>
>> No, it cannot do this.
>>
>> On Wed, Sep 9, 2009 at 3:55 PM, Andy Droid wrote:
>> >
>> > Could an alternate home screen app replace the assets such as s
>> > "menu_item_background_pressed.9.png" or
>> > "list_selector_background_focus.9.png", both found in  frameworks/base/
>> > core/res/res/drawable in the open source project?  I have altered
>> > those by changing out the assets and recompiling.
>> >
>> > But can I make it so the installation of the home screen will open up
>> > framework-res.apk, replace the asset, then re-package framework-
>> > res.apk?  I realize this would then have broad ramifications, but just
>> > wondering if it could be done.  thanks.
>> >
>> > Also wondering if a alt home screen app, can replace icons of core
>> > apps, such as Contacts, etc. 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
>>
>>
>>
>
> >
>


-- 
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 WVGA support

2009-09-09 Thread Dianne Hackborn
Sorry, yes.

On Wed, Sep 9, 2009 at 6:59 PM, Ed Burnette  wrote:

>
> Did you mean ?
>
> On Sep 9, 12:37 pm, Dianne Hackborn  wrote:
> > You'd do  > android:targetSdkVersion="4" /> and then configure the rest of the
> manifest
> > as desired.
> >
> >
> >
> > On Wed, Sep 9, 2009 at 2:12 AM, Al Sutton  wrote:
> >
> > > Dianne,
> >
> > > In the blog post can you cover how to produce one app which will run
> > > on cupcake and donut and support multiple resolutions.
> >
> > > As I understand things at the moment developers will need at least two
> > > versions of the same app listed in Market to cover both bases; One
> > > with minSDK="4" and the supports-screens manifest tag and a separate
> > > one for cupcake devices because cupcake won't run apps with minSDK >
> > > 3. If there is also a lite & paid for version you're then into 4 app
> > > listings for the same app (lite, paid-for, multi-resolution lite,
> > > multi-resolution paid-for), which seems like its' going to be a it of
> > > a pain.
> >
> > > Thanks,
> >
> > > Al.
> >
> > > On Sep 9, 7:35 am, Dianne Hackborn  wrote:
> > > > Supporting a wider variety of hardware has been an ongoing processes,
> and
> > > > was already started with 1.5 with the introduction of soft keyboards
> and
> > > > corresponding mechanisms for applications to declare they require
> hard
> > > > keyboards etc.  This will continue after Donut as well.
> >
> > > > We are not going to drop a hardware requirement without having a
> > > mechanism
> > > > for applications to specify that they need the hardware and a
> strategy
> > > for
> > > > grand-fathering existing applications into the filtering.
> >
> > > > On Tue, Sep 8, 2009 at 11:26 PM, gasolin  wrote:
> >
> > > > > Hello,
> >
> > > > > I was thinking there are plenty of hardware constrains in upcoming
> > > > > android devices,
> > > > > not only the screen resolution. There will be some devices without
> > > > > compass, wifi, g-sensor... ,etc.
> >
> > > > > It will be nice that developer could pre-claimed the app
> requirement
> > > > > and user could be notified before they install the app and feel bad
> > > > > while the app hang (mostly without notice).
> >
> > > > > Donut's  'supports-screens' tag could be easily extend to this
> > > > > suggested architecture if google guys think its helpful.
> > > > >http://code.google.com/p/android/issues/detail?id=3693
> >
> > > > > Please 'Star' this issue in the above link if you think it's good
> for
> > > > > android ecosystem.
> >
> > > > > regards
> > > > > --
> > > > > gasolin
> >
> > > > --
> > > > 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.
> >
>


-- 
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: change framework assets with alternate home screen

2009-09-09 Thread Romain Guy
No and no :)

On Wed, Sep 9, 2009 at 7:15 PM, Andy Droid  wrote:

> Thanks for the reply.  So once the system.img is flashed to the phone,
> there is really no way to change the contents of framework-res.apk?  Sorry
> for the redundant question, just verifying.
>
> And no way to change out a core app icon, such as Contacts?
>
> thanks
>
>
>
> On Wed, Sep 9, 2009 at 3:58 PM, Romain Guy  wrote:
>
>>
>> No, it cannot do this.
>>
>> On Wed, Sep 9, 2009 at 3:55 PM, Andy Droid wrote:
>> >
>> > Could an alternate home screen app replace the assets such as s
>> > "menu_item_background_pressed.9.png" or
>> > "list_selector_background_focus.9.png", both found in  frameworks/base/
>> > core/res/res/drawable in the open source project?  I have altered
>> > those by changing out the assets and recompiling.
>> >
>> > But can I make it so the installation of the home screen will open up
>> > framework-res.apk, replace the asset, then re-package framework-
>> > res.apk?  I realize this would then have broad ramifications, but just
>> > wondering if it could be done.  thanks.
>> >
>> > Also wondering if a alt home screen app, can replace icons of core
>> > apps, such as Contacts, etc. 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] Re: How can I start the ADB Deamon programatically ???

2009-09-09 Thread Dianne Hackborn
You could look at the source code and see how it is done.  I believe adb is
in the system/base project.

On Wed, Sep 9, 2009 at 7:24 PM, HandsomeboyIT wrote:

>
> I believe that the deamon service can be communicate with other
> application through TCP/IP protocol (localhost:5039). I just don't
> know how to start it. The ADB server run on the development machine
> can do this. It can send some commands to deamon service to start the
> deamon and retrieve data from that. I don't care if the SDK supports
> this, but I think there is a same way to start it.
>
> On Sep 10, 12:24 am, "Yusuf Saib (T-Mobile USA)"  Mobile.com> wrote:
> > I don't believe that's supported in the SDK.
> >
> > 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 Sep 8, 11:29 pm, HandsomeboyIT  wrote:
> >
> > > I want to communicate with the ADB Deamon service on device for get
> > > some special data without using ADB server on development machine
> > > (suggest that my application running on device and do not know about
> > > ABD tools, except deamon). Can anyone show me how to do this ??? How
> > > to start the deamon service ? what is its provided function/command ???
> >
> >
> >
>


-- 
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: screen size of emulator?

2009-09-09 Thread Dianne Hackborn
You generally don't, your views get told the size they should be as part of
the view hierarchy layout.  Directly getting the size of the display is not
recommended, because it may have no relation to the actual space your UI has
available (such as if there are other screen decorations around, like a task
switcher or who knows what).

On Wed, Sep 9, 2009 at 8:03 PM, mmkr  wrote:

>
> Hai,
>
> How can i get the screen size of my emulator?
> i used
>
> Display display = ((WindowManager) getSystemService
> (Context.WINDOW_SERVICE)).getDefaultDisplay();
>int width = display.getWidth();
>Log.i("width",""+width);
>
> But it gives me different values each time. How to find the exact
> value?
> >
>


-- 
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 get webview's content into a bitmap?

2009-09-09 Thread AJ

If somebody knows this, plz help me


- AJ

On Sep 9, 1:26 pm, Ajeet Singh  wrote:
> Hi gjs,
>
> Thanks for pointing that error. But that was a type error. Now I am
> pasting the correct code here.
>
> 
>
>        WebVieww = newWebView(this);
>         w.loadUrl("http://www.yahoo.com";);
>        BitmapmBitmap          = null;
>         ByteArrayOutputStream mByteArrayOpStream        = null;
>
>         //get the picture from thewebview
>         Picture picture = w.capturePicture();
>
>         //Create the new Canvas
>         Canvas mCanvas = new Canvas();
>
>         //Copy the view canvas to abitmap
>         try{
>                 //w.draw(mCanvas);
>                 //mCanvas.save();
>                 //picture.draw(mCanvas);
>                 mCanvas.drawPicture(picture);
>                 //int restoreToCount =mCanvas.save();
>                 //mCanvas.drawPicture(picture);
>                 //mCanvas.restore();
>         }
>         catch (Exception e) {
>                 e.printStackTrace();
>         }
>
>         mBitmap =Bitmap.createBitmap(w.getWidth(), w.getHeight
> (),Config.ARGB_);
>         mCanvas.drawBitmap(mBitmap, 0, 0, null);
>
>         if(mBitmap!= null) {
>                 mByteArrayOpStream = new ByteArrayOutputStream();
>                 mBitmap.compress(Bitmap.CompressFormat.JPEG, 90,
> mByteArrayOpStream);
>                 try {
>                         fos = openFileOutput("yahoo.jpg", 
> MODE_WORLD_WRITEABLE);
>                         fos.write(mByteArrayOpStream.toByteArray());
>                         fos.close();
>                 } catch (FileNotFoundException e) {
>                         e.printStackTrace();
>                 } catch (IOException e) {
>                         e.printStackTrace();
>                 }
>         }
>
> 
>
> Thanks,
> Ajeet Singh
>
> On Sep 9, 12:29 pm, gjs  wrote:
>
> > Hi,
>
> > the code you posted refers to mBitmapScreenshotonce, how did you
> > instantiate this, what is itcontent? black maybe...
>
> > your code also refers to screenshot but the only time you access is
> > when you attempt to compress itintoa byte array, what is it
> >content? black maybe...
>
> > Regards
>
> > PS you won't get much help here, if you can't be bothered to check
> > your own code...
>
> > On Sep 9, 4:40 pm, Ajeet Singh  wrote:
>
> > > Hi All,
>
> > > I am trying to get thewebview'scontenton abitmapso that i can
> > > save it as a image. But I am unable to so. I am getting the BLACK
> > > image save instead. Allcontentis missing :(
>
> > > Anybody can help me regarding this.
>
> > > Here is my code
>
> > > ~~
>
> > > //create awebview
> > >WebVieww = newWebView(this);
>
> > > //Loads the url
> > > w.loadUrl("http://www.yahoo.com";);
>
> > > //After loading completely, take its picture
> > > Picture picture = w.capturePicture();
>
> > > //Create a new canvas
> > > Canvas mCanvas = new Canvas();
>
> > > //Draw the Pictureintothe Canvas
> > > picture.draw(mCanvas);
>
> > > //Create aBitmap
> > >Bitmapsreenshot =Bitmap.createBitmap(picture.getWidth(),
> > > picture.getHeight(),Config.ARGB_);
>
> > > //copy thecontentfron Canvas toBitmap
> > > mCanvas.drawBitmap(mBitmapScreenshot, 0, 0, null);
>
> > > //Save theBitmapto local filesystem
> > > if(sreenshot != null) {
> > >         ByteArrayOutputStream mByteArrayOpStream = new
> > > ByteArrayOutputStream();
> > >         screenshot.compress(Bitmap.CompressFormat.JPEG, 90,
> > > mByteArrayOpStream);
> > >         try {
> > >                 fos = openFileOutput("yahoo.jpg",
> > > MODE_WORLD_WRITEABLE);
> > >                 fos.write(mByteArrayOpStream.toByteArray());
> > >                 fos.close();
> > >         } catch (FileNotFoundException e) {
> > >                 e.printStackTrace();
> > >         } catch (IOException e) {
> > >                 e.printStackTrace();
> > >         }
>
> > > }
>
> > > ~~
>
> > > Thanks,
> > > AJ
>
>
--~--~-~--~~~---~--~~
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: Microphone signal ..source

2009-09-09 Thread Rud

What you are asking for is a non-trivial problem. To determine the
frequency of a signal you have to capture a number of samples. Whether
they go to a memory buffer or SD is a detail. You then need to perform
a Fast Fourier Transform (or similar transform for the pedantic ones)
to determine the frequency. The more samples you collect the more
accurate the result. You need more samples to (1) make a more fine
grade determination of the frequency and (2) to increase the signal to
noise ratio.

Rud


On Aug 31, 3:08 pm, guruk  wrote:
> Hi,
> i look for a very simple example what signal arrives at my mic in
> realtime.
> It does not need to be saved to sd-card or anything.
>
> Just a $vol=GetVolume   (0-)
> $frequ=Getfrequ (0-28000)
>
> something like that.
>
> The Examples I found are just overloaded and mostly to record some
> seconds to sd-card. I dont need that at all, just whats the signal
> right
> now arriving :)
>
> thanks i advance
>
> any snippet can help
>
> 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] screen size of emulator?

2009-09-09 Thread mmkr

Hai,

How can i get the screen size of my emulator?
i used

Display display = ((WindowManager) getSystemService
(Context.WINDOW_SERVICE)).getDefaultDisplay();
int width = display.getWidth();
Log.i("width",""+width);

But it gives me different values each time. How to find the exact
value?
--~--~-~--~~~---~--~~
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 can I start the ADB Deamon programatically ???

2009-09-09 Thread HandsomeboyIT

I believe that the deamon service can be communicate with other
application through TCP/IP protocol (localhost:5039). I just don't
know how to start it. The ADB server run on the development machine
can do this. It can send some commands to deamon service to start the
deamon and retrieve data from that. I don't care if the SDK supports
this, but I think there is a same way to start it.

On Sep 10, 12:24 am, "Yusuf Saib (T-Mobile USA)"  wrote:
> I don't believe that's supported in the SDK.
>
> 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 Sep 8, 11:29 pm, HandsomeboyIT  wrote:
>
> > I want to communicate with the ADB Deamon service on device for get
> > some special data without using ADB server on development machine
> > (suggest that my application running on device and do not know about
> > ABD tools, except deamon). Can anyone show me how to do this ??? How
> > to start the deamon service ? what is its provided function/command ???
>
>
--~--~-~--~~~---~--~~
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: change framework assets with alternate home screen

2009-09-09 Thread Andy Droid
Thanks for the reply.  So once the system.img is flashed to the phone, there
is really no way to change the contents of framework-res.apk?  Sorry for the
redundant question, just verifying.

And no way to change out a core app icon, such as Contacts?

thanks



On Wed, Sep 9, 2009 at 3:58 PM, Romain Guy  wrote:

>
> No, it cannot do this.
>
> On Wed, Sep 9, 2009 at 3:55 PM, Andy Droid wrote:
> >
> > Could an alternate home screen app replace the assets such as s
> > "menu_item_background_pressed.9.png" or
> > "list_selector_background_focus.9.png", both found in  frameworks/base/
> > core/res/res/drawable in the open source project?  I have altered
> > those by changing out the assets and recompiling.
> >
> > But can I make it so the installation of the home screen will open up
> > framework-res.apk, replace the asset, then re-package framework-
> > res.apk?  I realize this would then have broad ramifications, but just
> > wondering if it could be done.  thanks.
> >
> > Also wondering if a alt home screen app, can replace icons of core
> > apps, such as Contacts, etc. 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: Android WVGA support

2009-09-09 Thread Ed Burnette

Did you mean ?

On Sep 9, 12:37 pm, Dianne Hackborn  wrote:
> You'd do  android:targetSdkVersion="4" /> and then configure the rest of the manifest
> as desired.
>
>
>
> On Wed, Sep 9, 2009 at 2:12 AM, Al Sutton  wrote:
>
> > Dianne,
>
> > In the blog post can you cover how to produce one app which will run
> > on cupcake and donut and support multiple resolutions.
>
> > As I understand things at the moment developers will need at least two
> > versions of the same app listed in Market to cover both bases; One
> > with minSDK="4" and the supports-screens manifest tag and a separate
> > one for cupcake devices because cupcake won't run apps with minSDK >
> > 3. If there is also a lite & paid for version you're then into 4 app
> > listings for the same app (lite, paid-for, multi-resolution lite,
> > multi-resolution paid-for), which seems like its' going to be a it of
> > a pain.
>
> > Thanks,
>
> > Al.
>
> > On Sep 9, 7:35 am, Dianne Hackborn  wrote:
> > > Supporting a wider variety of hardware has been an ongoing processes, and
> > > was already started with 1.5 with the introduction of soft keyboards and
> > > corresponding mechanisms for applications to declare they require hard
> > > keyboards etc.  This will continue after Donut as well.
>
> > > We are not going to drop a hardware requirement without having a
> > mechanism
> > > for applications to specify that they need the hardware and a strategy
> > for
> > > grand-fathering existing applications into the filtering.
>
> > > On Tue, Sep 8, 2009 at 11:26 PM, gasolin  wrote:
>
> > > > Hello,
>
> > > > I was thinking there are plenty of hardware constrains in upcoming
> > > > android devices,
> > > > not only the screen resolution. There will be some devices without
> > > > compass, wifi, g-sensor... ,etc.
>
> > > > It will be nice that developer could pre-claimed the app requirement
> > > > and user could be notified before they install the app and feel bad
> > > > while the app hang (mostly without notice).
>
> > > > Donut's  'supports-screens' tag could be easily extend to this
> > > > suggested architecture if google guys think its helpful.
> > > >http://code.google.com/p/android/issues/detail?id=3693
>
> > > > Please 'Star' this issue in the above link if you think it's good for
> > > > android ecosystem.
>
> > > > regards
> > > > --
> > > > gasolin
>
> > > --
> > > 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: Setting empty text on listView that does not have @+android:list as its ID?

2009-09-09 Thread Mark Murphy

Lee wrote:
> I've got a tabhost that has a number of tabs that all contain a
> ListView (among other widgets).
> 
> I need to address each ListView separately and so they all have a
> unique ID that is not @+android:list.
> 
> How does one define the empty text for a list if the only way that it
> can be done is through the assumption that the list will have an id of
> @+id/android:list and the empty text @+id/android:empty

For an empty list, just make the ListView be invisible
(setVisibility(View.INVISIBLE)) and make an associated TextView be
visible. Use FrameLayout (or RelativeLayout) so they can take up the
same space in the GUI, just one or the other being visible.

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

_Android Programming Tutorials_ Version 1.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] Setting empty text on listView that does not have @+android:list as its ID?

2009-09-09 Thread Lee

I've got a tabhost that has a number of tabs that all contain a
ListView (among other widgets).

I need to address each ListView separately and so they all have a
unique ID that is not @+android:list.

How does one define the empty text for a list if the only way that it
can be done is through the assumption that the list will have an id of
@+id/android:list and the empty text @+id/android:empty

Thanks
Lee
--~--~-~--~~~---~--~~
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: Microphone signal ..source

2009-09-09 Thread Josh

Im looking for the same thing? Can anyone help with this?

On Aug 31, 1:08 pm, guruk  wrote:
> Hi,
> i look for a very simple example what signal arrives at mymicin
> realtime.
> It does not need to be saved to sd-card or anything.
>
> Just a $vol=GetVolume   (0-)
> $frequ=Getfrequ (0-28000)
>
> something like that.
>
> The Examples I found are just overloaded and mostly to record some
> seconds to sd-card. I dont need that at all, just whats the signal
> right
> now arriving :)
>
> thanks i advance
>
> any snippet can help
>
> 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: Play audio over an active phone call, so other end can hear it

2009-09-09 Thread Josh

have you figured out how to do this?

On Aug 20, 8:39 am, tcp  wrote:
> jsdf -
>
> Did you find an answer to this question somewhere?
>
> It is related to one of my own which is, can I write my own phone app?
>
> It would seem odd if there was no _possible_ programmatic interface to
> the audio streams (which would also preclude what I'm trying to do)
> because, even if the audio codecs are on the CPU (which I believe is
> the case in G1/ADP-land) somehow those data need to get to/from
> speakers/mics which are programmatically accessible.
>
> I'm poking around in com.android.internal.telephony for my stuff and
> will be trying some tests in the coming week or so.  I'll post
> anything of interest here.
>
> All comments are welcome.
>
> Thanks,
> - tcp
>
> On Aug 8, 7:45 am, jsdf  wrote:
>
>
>
> > Marco,
> > Just to clarify,
> > The sticking points could be:
> > 1.) hardware design doesn't support it
> > 2.) framework software that integrates Android onto specific phones
> > doesn't allow it
> > 3.) Android doesn't support it
>
> > I definitely see #3 as true.  Does your comment below indicate #1, #2,
> > or both #1 and #2 are true?
> > Thanks for the help,
> > jsdf
>
> > On Aug 7, 1:24 pm, Marco Nelissen  wrote:
>
> > > The hardware doesn't support it. The closest you can get is by playing
> > > it over the speaker at full volume, so themicrophonewill pick it up.
>
> > > On Fri, Aug 7, 2009 at 9:26 AM,jsdf wrote:
>
> > > > Hi everyone,
>
> > > > Is it possible to playaudioover an activephonecall, so the other
> > > > end can hear it?
>
> > > > For example:
> > > > A and B are talking on thephone.
> > > > A presses a button that pullsaudiofrom a resource and plays it over
> > > > thephonecallto B.
>
> > > > If so, what libraries should I look into?
>
> > > > If not, is this something that could become accessible on rooted
> > > > phones? (Of course, only other rooted phones would be able to use the
> > > > application then...)
>
> > > > Thanks,
> > > >jsdf- 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: How i can create usable android project's library

2009-09-09 Thread kostmo

Oops, I'll have to retract that; my test was invalid.  The manifest
lines I added were incorrect (forgot the  tags),
causing my new version not to be installed...

I do indeed find problems in my log now, such as:
09-09 19:28:11.484: WARN/ResourceType(580): No package identifier when
getting value for resource number 0x7f06

-and-

09-09 19:29:18.184: ERROR/AndroidRuntime(3002): Caused by:
java.lang.RuntimeException: Your content must have a ListView whose id
attribute is 'android.R.id.list'

followed by F/C.

Sorry for the mix-up!

I was also misled by the fact that I could reference the ID's of the
resources inside the JAR, suggested by Eclipse's autocomplete
behavior.

I think the best way to accomplish what I was intending will be to
install an entirely separate .apk with the libraries.

Karl

On Sep 9, 6:32 pm, Mark Murphy  wrote:
> kostmo wrote:
> >> Bear in mind also that your library cannot package any resources, making
> >> activities that much more difficult to package in a library.
>
> > I'm not sure that is true.
>
> > I have created a .jar from a project that happens to include some
> > layout files.  I import this .jar from a second project, and add a few
> > lines to the second project's Manifest file:
>
> >      > android:name="com.googlecode.chartdroid.ChartPanelActivity"
> > android:theme="@android:style/Theme.Translucent">
> >             > android:name="com.googlecode.chartdroid.intent.action.PLOT" />
> >            
> >     
>
> > When I launch the .jar'd activity from the second activity with an
> > implicit intent, it appears to work fine.  The layout resources that
> > the .jar'd activity uses exist only within the .jar file.
>
> *blink, blink*
>
> How do you have the resources packaged in the JAR?
>
> Thanks!
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 1.0 In Print!
--~--~-~--~~~---~--~~
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] Integrate InstrumentationTestRunner on adb shell with ant for continuous integration and TDD

2009-09-09 Thread Agus
Hi all,

I am just wondering if anyone has successfully integrate the result from
calling InstrumentationTestRunner with ant, instead of parsing the log
manually and extract the test results.
my goal is to setup a continuous integration test-driven development by
executing test cases periodically on the device.

Thanks,
Agus.

--~--~-~--~~~---~--~~
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: Voice 2 text help

2009-09-09 Thread Mark Murphy

Abhi wrote:
> Is there no one who could help me on this? Mark Murphy?

Uh, hi!

Sorry, I have not played with voice-to-text yet.

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

_Android Programming Tutorials_ Version 1.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: Voice 2 text help

2009-09-09 Thread Abhi

Is there no one who could help me on this? Mark Murphy?

On Sep 8, 10:15 am, Abhi  wrote:
> Hi guys,
>
> I have been trying to develop an app around the voice recognition
> functionality of Cupcake. As a sample code, I used the
> VoiceRecognition.java project available under API Demos. (http://
> developer.android.com/guide/samples/ApiDemos/src/com/example/android/
> apis/app/VoiceRecognition.html)
>
> I want to know if I can extract the text result on the list view and
> use it as a String further on? The part of code I am refering to is
> below where mList is defined as ListView:
>
> ArrayList matches = data.getStringArrayListExtra
> (RecognizerIntent.EXTRA_RESULTS);
> mList.setAdapter(new ArrayAdapter(this,
> android.R.layout.simple_list_item_1, matches));
>
> I want to use the result to be able to take further action.
>
> Thanks,
>
> Abhi
--~--~-~--~~~---~--~~
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: Deep sleep behaviour

2009-09-09 Thread Dianne Hackborn
Thanks Mark, that is a great explanation.

Another way one can look at this: your app is probably not nearly that
important to most of your users.  We are increasingly working on ways to let
the users know which apps are doing this kind of stuff, so they can make
good decisions about the things running on their device, and uninstall such
apps if they don't find them important enough.

On Wed, Sep 9, 2009 at 2:45 PM, Mark Murphy  wrote:

>
> Lee wrote:
> > Following that philosophy to the end, the user should never turn the
> > device on.
>
> How much power cost is depends greatly upon what one is doing. An
> every-5-seconds service is pretty likely to be very bad for battery life.
>
> I really encourage everyone to watch Jeff Sharkey's Google I/O 2009
> presentation:
>
> http://code.google.com/events/io/sessions/CodingLifeBatteryLife.html
>
> Quoting from the key slide for this case:
>
> "* Waking up in the background when the phone would otherwise be sleeping
>* App wakes up every 10 minutes to update
>* Takes about 8 seconds to update, 350mA
> * Cost during a given hour:
>* 3600 seconds * 5mA = 5mAh resting
>* 6 times * 8 sec * 350 mA = 4.6mAh updating"
>
> Now, his case was for an app that was updating data over the Internet,
> which is why his power usage was 350mA for that period.
>
> In the case of an every-5-second service, I will make two assumptions:
>
> 1. Battery usage will be around 20mA, mid-way between totally idle and
> typical usage.
>
> 2. That it will effectively continuously draw that power, as a
> combination of its own code and other system-level things that go on as
> a result of its code, and the fact that the CPU might effectively stay
> awake during the whole time handling all of that.
>
> That means that, during an hour, it'll draw 20mAh, versus 5mAh for
> normal idle.
>
> So, let's take a user that seriously uses the device for only about an
> hour a day (350mA), etc. With a G1, that should result in slightly over
> two days runtime between charges (2 hours usage @ 350mA, 46 hours idle @
> 5mA = 930mAh compared to 1150mAh capacity). The every-5-seconds app will
> cut that back to slightly over one day (1 hour usage @ 350mAh, 23 hours
> idle @ 20mAh = 810mAh).
>
> In other words, *one app* roughly halves the battery life of the G1.
>
> Obviously, actual real-world testing would have to be done, because my
> estimates may be high or low, as I know neither the code being executed
> every 5 seconds nor the specific details on if the device will actually
> fall back asleep much in between the 5-second intervals.
>
> However, this effect, I suspect, is why Ms. Hackborn asked that
> developers not do this.
>
> Now, if you are developing code to go in firmware on some set-top box,
> or something else that has a continuous source of power, then this issue
> falls away. But for a mobile device, something that effectively runs all
> the time is a bad idea.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Android Development Wiki: http://wiki.andmob.org
>
> >
>


-- 
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 i can create usable android project's library

2009-09-09 Thread Mark Murphy

kostmo wrote:
>> Bear in mind also that your library cannot package any resources, making
>> activities that much more difficult to package in a library.
> 
> I'm not sure that is true.
> 
> I have created a .jar from a project that happens to include some
> layout files.  I import this .jar from a second project, and add a few
> lines to the second project's Manifest file:
> 
>  android:name="com.googlecode.chartdroid.ChartPanelActivity"
> android:theme="@android:style/Theme.Translucent">
>android:name="com.googlecode.chartdroid.intent.action.PLOT" />
>   
> 
> 
> When I launch the .jar'd activity from the second activity with an
> implicit intent, it appears to work fine.  The layout resources that
> the .jar'd activity uses exist only within the .jar file.

*blink, blink*

How do you have the resources packaged in the JAR?

Thanks!

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

_Android Programming Tutorials_ Version 1.0 In Print!

--~--~-~--~~~---~--~~
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: latitude buddies content provider

2009-09-09 Thread Dianne Hackborn
This is not a public API.  Any attempts you make at using it will break in
the future.

On Wed, Sep 9, 2009 at 3:54 PM, Arno den Hond  wrote:

>
> Perhaps a developer who worked on the maps app can answer this
> question?
> would appreciate it a lot!
>
> >
>


-- 
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 i can create usable android project's library

2009-09-09 Thread kostmo

> Bear in mind also that your library cannot package any resources, making
> activities that much more difficult to package in a library.

I'm not sure that is true.

I have created a .jar from a project that happens to include some
layout files.  I import this .jar from a second project, and add a few
lines to the second project's Manifest file:






When I launch the .jar'd activity from the second activity with an
implicit intent, it appears to work fine.  The layout resources that
the .jar'd activity uses exist only within the .jar file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: avoid splash screen if a service is running...

2009-09-09 Thread sdphil

hm...  this is pretty good --
http://stackoverflow.com/questions/600207/android-check-if-a-service-is-running

any objections?

On Sep 9, 4:08 pm, sdphil  wrote:
> when my activity gets started, i want to check for a service, if it
> exists, I want to show screen 2 and bind to the service, if the
> service is not running, I want to show screen 1 and start the service.
>
> i could not find an easy way to know whether the service is running or
> not...
>
> 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] avoid splash screen if a service is running...

2009-09-09 Thread sdphil

when my activity gets started, i want to check for a service, if it
exists, I want to show screen 2 and bind to the service, if the
service is not running, I want to show screen 1 and start the service.

i could not find an easy way to know whether the service is running or
not...

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] Re: Video quality

2009-09-09 Thread Engin Arslan

To be more specific, When I captured video, it only capture left top
of screen with low quality as if it zooms top left of screen. What can
be problem?

On Sep 9, 10:07 pm, Engin Arslan  wrote:
> Hi, i am capturing video with the code below. But there is problem on
> videoquality, that is, when I capture video with applicaiton I wrote
> itsqualityis not as well as videoqualityof telepohnes' which is
> recorded by Camcorder.
>
> public CamcorderPreview(Context context, AttributeSet attrs) {
>         super(context, attrs);
>         holder = getHolder();
>         holder.addCallback(this);
>         holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
>         recorder = new MediaRecorder();
>         recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
>         recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
>         recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
>         recorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
>          recorder.setVideoSize(352,288);
>          createVideoPath();
>                  recorder.setOutputFile(mCameraVideoFilename);
>                   recorder.setVideoEncoder
> (MediaRecorder.VideoEncoder.H263);
>                   recorder.setAudioEncoder
> (MediaRecorder.AudioEncoder.AMR_NB);
>
>                  recorder.setPreviewDisplay(holder.getSurface());
>
>
>
> }- 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: change framework assets with alternate home screen

2009-09-09 Thread Romain Guy

No, it cannot do this.

On Wed, Sep 9, 2009 at 3:55 PM, Andy Droid wrote:
>
> Could an alternate home screen app replace the assets such as s
> "menu_item_background_pressed.9.png" or
> "list_selector_background_focus.9.png", both found in  frameworks/base/
> core/res/res/drawable in the open source project?  I have altered
> those by changing out the assets and recompiling.
>
> But can I make it so the installation of the home screen will open up
> framework-res.apk, replace the asset, then re-package framework-
> res.apk?  I realize this would then have broad ramifications, but just
> wondering if it could be done.  thanks.
>
> Also wondering if a alt home screen app, can replace icons of core
> apps, such as Contacts, etc. 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] change framework assets with alternate home screen

2009-09-09 Thread Andy Droid

Could an alternate home screen app replace the assets such as s
"menu_item_background_pressed.9.png" or
"list_selector_background_focus.9.png", both found in  frameworks/base/
core/res/res/drawable in the open source project?  I have altered
those by changing out the assets and recompiling.

But can I make it so the installation of the home screen will open up
framework-res.apk, replace the asset, then re-package framework-
res.apk?  I realize this would then have broad ramifications, but just
wondering if it could be done.  thanks.

Also wondering if a alt home screen app, can replace icons of core
apps, such as Contacts, etc. 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: latitude buddies content provider

2009-09-09 Thread Arno den Hond

Perhaps a developer who worked on the maps app can answer this
question?
would appreciate it a lot!

--~--~-~--~~~---~--~~
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 with Spinner

2009-09-09 Thread Mark Murphy

EverettG wrote:
> I am creating a Spinner but when it displays in the Emulator it does
> not display any sort of arrow to let the user know to click on it. If
> you click on it, it works properly and you can choose from the items.
> I have looked through Internet resources and three books but cannot
> seem to find an answer to this. Here are my files:



> testSpinner.setBackgroundColor(Color.BLUE);

Get rid of this line, and I suspect your drop-down button will appear.

Most interactive widgets in Android use the background for part of the
interactivity. In the case of Spinner, I think the drop-down button is
part of the background of the widget. By replacing the standard
background with a solid blue background, you inadvertently "take out"
the drop-down button.

You'll run into this problem as well if you try replacing the background
of any widget that is focusable (e.g., Button), as the orange focus ring
is part of the widget background.

If you truly wish to customize the widget background, you can do so, but
you will need to jump through a fair number of hoops. FWIW, I just made
a note to cover some of that process in the next update to my Advanced
Android book.

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

Android 1.5 Programming 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: android-developers - 26 new messages in 16 topics - digest

2009-09-09 Thread Bartolo Illiano
Who use a Titanium Developer for buld android apps ?

--~--~-~--~~~---~--~~
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 with Spinner

2009-09-09 Thread EverettG

I am creating a Spinner but when it displays in the Emulator it does
not display any sort of arrow to let the user know to click on it. If
you click on it, it works properly and you can choose from the items.
I have looked through Internet resources and three books but cannot
seem to find an answer to this. Here are my files:
spinner.xml:

http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>





arrays.xml


  
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
  


TestSpinner.java
package com.aapg.AndroidViews;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;

public class TestSpinner extends Activity
{
  private int spinnerBackgroundColor = Color.BLUE;
  //private static final String[] MONTHS = new String[]
  //
{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};

  @Override
  public void onCreate(Bundle savedInstanceState)
  {
super.onCreate(savedInstanceState);
setContentView(R.layout.spinner);

//Get a reference to the Spinner.
final Spinner testSpinner = (Spinner)findViewById
(R.id.testSpinner);
testSpinner.setBackgroundColor(Color.BLUE);
//Set up the ArrayAdapter.
//ArrayAdapter arrayAdapter = new ArrayAdapter
(this,
//android.R.layout.simple_spinner_item,
MONTHS);
ArrayAdapter arrayAdapter =
ArrayAdapter.createFromResource(this,
R.array.months,
android.R.layout.simple_spinner_item);
//Set up the DropDownViewResource.
arrayAdapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
//Attach the Spinner to the ArrayAdapter.
testSpinner.setAdapter(arrayAdapter);

final Button enableToggleButton = (Button)findViewById
(R.id.enableToggleButton);
enableToggleButton.setOnClickListener(new
Button.OnClickListener()
{
  public void onClick(View v)
  {
changeEnabled(testSpinner);
  }//onClick().
});//Button.setOnClickListener().

final Button changeColorButton = (Button)findViewById
(R.id.changeColorButton);
changeColorButton.setOnClickListener(new Button.OnClickListener
()
{
  public void onClick(View v)
  {
changeSpinnerBackgroundColor(testSpinner);
  }//onClick().
});//Button.setOnClickListener().
  }//onCreate().

  public void changeEnabled(Spinner testSpinner)
  {
if(testSpinner.isEnabled())
{
  testSpinner.setEnabled(false);
}//if(testSpinner.isEnabled()).
else
{
  testSpinner.setEnabled(true);
}//else.
  }//changeEnabled(Spinner testSpinner2).

  public void changeSpinnerBackgroundColor(Spinner testSpinner)
  {
if(spinnerBackgroundColor == Color.BLUE)
{
  testSpinner.setBackgroundColor(Color.YELLOW);
  spinnerBackgroundColor = Color.YELLOW;
}//if(SPINNER_BACKGROUND_COLOR == Color.BLUE)
else
{
  testSpinner.setBackgroundColor(Color.BLUE);
  spinnerBackgroundColor = Color.BLUE;
}//else.
  }//changeSpinnerBackgroundColor(Spinner testSpinner).

}//AutoComplete class.

Thanks for your help.

EverettG.

--~--~-~--~~~---~--~~
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: Is it possible to use the accelerometer in a background service?

2009-09-09 Thread John Smith

2009/9/10 dadical :
>
> I register a listener to orientation sensor from within a background
> service with no trouble.  Perhaps the following code may help.  These
> methods are called from my service's onCreate and onDestroy methods:
>
>        private void startMonitoring(){
>                SensorManager lMgr = (SensorManager) getSystemService
> (Context.SENSOR_SERVICE);
>
>                try{
>                        lMgr.unregisterListener(this);
>                } catch(Exception e){
>                        Log.d(ScreeblService.class.getSimpleName(), 
> e.toString());
>                }
>
>                List lSensorList = lMgr.getSensorList
> (Sensor.TYPE_ORIENTATION);
>                if(lSensorList == null || lSensorList.size() == 0){
>                        throw new RuntimeException("Orientation sensor not 
> available!");
>                }
>
>                                // assumes that this class implements
> SensorEventListener
>                lMgr.registerListener( this, lSensorList.get(0),
> SensorManager.SENSOR_DELAY_NORMAL );
>
>        }
>
>        private void stopMonitoring(){
>                SensorManager lMgr = (SensorManager) getSystemService
> (Context.SENSOR_SERVICE);
>
>                try{
>                        lMgr.unregisterListener(this);
>                } catch(Exception e){
>                        Log.d(ScreeblService.class.getSimpleName(), 
> e.toString());
>                }
>
>        }
>
>
> On Sep 9, 1:41 pm, Mike Collins  wrote:
>> my service uses "getBaseContext()", seems to work just fine.  Don't
>> use it for
>> GPS but we do use it for many other things.
>>
>>   mike
>>
>> On Sep 9, 6:57 am, John Smith  wrote:
>>
>>
>>
>> > It seems trivial to use GPS in a background service, but how can you
>> > do the same with the accelerometer?
>>
>> > Everything I've tried seems to require a context, but a background
>> > service doesn't have a context?- Hide quoted text -
>>
>> - Show quoted text -
> >
>

Thanks for that I think the problem was far simpler, I was coding late
at night and I didn't set the class to implement SensorEventListener
:)

--~--~-~--~~~---~--~~
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: IllegalArgumentException occur: parameter must be a descendant of this view in ViewGroup.java:2454

2009-09-09 Thread Lucas

Hello,

Do you know the issue ID that this fix has assigned?

Thanks,

Lucas

On Aug 24, 4:12 am, Romain Guy  wrote:
> This issue is fixed in Donut but the source code available in the open
> is not the latest version.
>
> 2009/8/24 Justin :
>
>
>
>
>
> > This issue still happened in Donut.
>
> > I want to describe my structure first. There are two main view in my
> > Activity, one is Gallery another is a FrameLayout, I named it
> > FullSizeViewer which can show fit-to-screen photo. When tapping a
> > photo in Gallery, the screen changes to FullSizeViewer. FullSizeViewer
> > adds and removes from PhoneWindow dynamically.
> > The Gallery and FullSizeViewer load photo from SD card dynamically
> > (Loading and decoding in the other thread, and posted bitmap back to
> > main thread).
>
> > I found there is a member variable called 'mRealFocusedView' in
> > ViewRoot which sets to a wrong view (the view doesn't detach to any
> > parent) when this exception occurs and ViewRoot uses this wrong view
> > to calculating scroll distance and drawing rectangle.
>
> > In my case, when tapping a photo in Gallery and enter in
> > FullSizeViewer, the mRealFocusedView of ViewRoot is correct basically.
> > Sometimes the mRealFocusedView of ViewRoot is the Gallery's child
> > view. At this moment, this issue occurs.
>
> > I tried to set visibility of Gallery's child view to GONE and it is
> > not help because the 'mRealFocusedView' of ViewRoot still not correct
> > view.
> > I also tried to not dynamically add or remove FullSizeViewer, but this
> > issue still happened.
>
> > The only way to solve this issue is use two Activities, one Activity
> > contains Gallery, and another contains FullSizeViewer.
> > But it is too slow when activity change and the screen will become
> > black for a while.
> > It is not acceptable for me. Besides, I need to do some transition
> > animation when changing from Gallery to FullSizeViewer.
> > If I use two Activities, the animation can not be implemented.
>
> > I have tried to clear 'mRealFocusedView' to null by calling the
> > 'clearChildFocus' of decoreView before the moment of exception
> > happened.
> > It only can reduce the probability of this issue but it can't really
> > fix this issue.
>
> > There are three situations easily to reproduce this issue.
> > 1. Device is busy.
> > 2. When tapping photo in Gallery, keep using track ball to scroll the
> > Gallery.
> > 3. When you scroll or re-layout the Gallery, press Google search key
> > and then press back immediately.
>
> > Is there any solution or work-around to prevent this issue happen?
>
> > Here are my logs:
>
> > 08-21 09:43:31.583 W/dalvikvm(  863): threadid=3: thread exiting with
> > uncaught exception (group=0x4001db88)
> > 08-21 09:43:31.583 E/AndroidRuntime(  863): Uncaught handler: thread
> > main exiting due to uncaught exception
> > 08-21 09:43:31.693 E/AndroidRuntime(  863):
> > java.lang.IllegalArgumentException: parameter must be a descendant of
> > this view
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:
> > 2519)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:
> > 2456)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewRoot.scrollToRectOrFocus(ViewRoot.java:1554)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewRoot.draw(ViewRoot.java:1291)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewRoot.performTraversals(ViewRoot.java:1174)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.view.ViewRoot.handleMessage(ViewRoot.java:1769)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.os.Looper.loop(Looper.java:123)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > android.app.ActivityThread.main(ActivityThread.java:4203)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> > (ZygoteInit.java:791)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> > 08-21 09:43:31.693 E/AndroidRuntime(  863): at
> > dalvik.system.NativeStart.main(Native Method)
>
> > On 8月20日, 上午1時15分, "Yusuf Saib (T-Mobile USA)"  > Mobile.com> wrote:
> >> Or you could git donut.
>
> >>   ___
> >>.-"   "-.
> >>  .'   . ;   `.
> >> /: . ' :  \
> >>|   `  .-. . '  |
> >>|  :  (   ) ; ` |

[android-developers] Re: About intercept api calls

2009-09-09 Thread Mark Murphy

tony wrote:
> I want to write an app to do the api calls interception just like what
> "Detour" does under windows.
> Once the app is running it can hijack all the api calls other app made
> to the system.
> Anybody can give me any idea about achieving that?

I sincerely hope it is impossible, as it would represent a security hole
big enough to swallow Mt. Everest.

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

Android 1.5 Programming 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] How to use drawable resource in custom XML?

2009-09-09 Thread Robi

Hey guys,

so I have an XML file: xml/catalog.xml
which contains gallery and pictures.

Like this:


http://schemas.android.com/apk/res/android";>










In my view I can extract the attribute values using getAttributeValue
() in XmlPullParser, and the result is a string.
But could I somehow get the drawable resource right away? (That's why
I put the @ in the beginning)

getAttributeNameResource() gives null so that ain't good.

Any ideas?

--~--~-~--~~~---~--~~
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: font android

2009-09-09 Thread Mark Murphy

arroyopablobenjamin wrote:
> i want used the font of android in gimp or inkscape...where i can
> download?
> how this:
> http://img.xataka.com/2007/12/Android_Logo.jpg

http://www.android.com/branding.html

"Android Custom Typeface: The custom typeface may not be used."

Sorry!

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

Android 1.5 Programming 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] About intercept api calls

2009-09-09 Thread tony

Hi all there,

I want to write an app to do the api calls interception just like what
"Detour" does under windows.
Once the app is running it can hijack all the api calls other app made
to the system.
Anybody can give me any idea about achieving that?

Best
Tony

--~--~-~--~~~---~--~~
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] font android

2009-09-09 Thread arroyopablobenjamin

i want used the font of android in gimp or inkscape...where i can
download?
how this:
http://img.xataka.com/2007/12/Android_Logo.jpg

--~--~-~--~~~---~--~~
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: Deep sleep behaviour

2009-09-09 Thread Mark Murphy

Lee wrote:
> Following that philosophy to the end, the user should never turn the
> device on.

How much power cost is depends greatly upon what one is doing. An
every-5-seconds service is pretty likely to be very bad for battery life.

I really encourage everyone to watch Jeff Sharkey's Google I/O 2009
presentation:

http://code.google.com/events/io/sessions/CodingLifeBatteryLife.html

Quoting from the key slide for this case:

"* Waking up in the background when the phone would otherwise be sleeping
* App wakes up every 10 minutes to update
* Takes about 8 seconds to update, 350mA
* Cost during a given hour:
* 3600 seconds * 5mA = 5mAh resting
* 6 times * 8 sec * 350 mA = 4.6mAh updating"

Now, his case was for an app that was updating data over the Internet,
which is why his power usage was 350mA for that period.

In the case of an every-5-second service, I will make two assumptions:

1. Battery usage will be around 20mA, mid-way between totally idle and
typical usage.

2. That it will effectively continuously draw that power, as a
combination of its own code and other system-level things that go on as
a result of its code, and the fact that the CPU might effectively stay
awake during the whole time handling all of that.

That means that, during an hour, it'll draw 20mAh, versus 5mAh for
normal idle.

So, let's take a user that seriously uses the device for only about an
hour a day (350mA), etc. With a G1, that should result in slightly over
two days runtime between charges (2 hours usage @ 350mA, 46 hours idle @
5mA = 930mAh compared to 1150mAh capacity). The every-5-seconds app will
cut that back to slightly over one day (1 hour usage @ 350mAh, 23 hours
idle @ 20mAh = 810mAh).

In other words, *one app* roughly halves the battery life of the G1.

Obviously, actual real-world testing would have to be done, because my
estimates may be high or low, as I know neither the code being executed
every 5 seconds nor the specific details on if the device will actually
fall back asleep much in between the 5-second intervals.

However, this effect, I suspect, is why Ms. Hackborn asked that
developers not do this.

Now, if you are developing code to go in firmware on some set-top box,
or something else that has a continuous source of power, then this issue
falls away. But for a mobile device, something that effectively runs all
the time is a bad idea.

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

Android Development Wiki: http://wiki.andmob.org

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



[android-developers] Translucent and FullScreen?

2009-09-09 Thread Illidane

Hi!
I have an issue : I set Theme.Translucent.NoTitleBar.Fullscreen for my
app, but status bar is still here. Is there a solution for it?
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: Deep sleep behaviour

2009-09-09 Thread Lee

> > You can detect screen off and set an alarm every 5 seconds to poke the
> > service if you want to keep it doing something.
> > While the service is busy, make sure you hold a partial wake lock.
> > Have a look at the SMSPopup for an example of wakelock management.
>
> Please don't do this.  Waking up from an alarm every 5 seconds is going to
> cause a noticeable drain on the battery.

Following that philosophy to the end, the user should never turn the
device on.

Is there an alternative to an alarm, on the assumption that the
application
requires every-5-second processing ?

Lee
--~--~-~--~~~---~--~~
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: Animation of a View

2009-09-09 Thread Eddified

another problem:
c) if something changes and I need to reverse the animation from it's
current half-way state, without completing the animation and without
simply clearing it, I don't see any way to accomplish this using the
Animation classes.

Given these problems, what approach should I take?

On Sep 9, 2:53 pm, Eddified  wrote:
> I understand that animating a View using startAnimation() with a
> TranslateAnimation object really just applies a transform on the
> canvas that is being drawn on. In my case, the problems with this are:
> a) sometimes I need to call bringChildToFront() (for a different View)
> on the ViewGroup during the animation, which messes up the animation
> because it triggers a requestLayout on all children, which in turn re-
> lays out the child being animated... which messes up the continuity of
> the animation. Perhaps causing a layout on the child being animated
> isn't supposed to mess up animations, but it seems to be in my case.
> b) after the animation (using an AnimationListener), I need to re-
> layout the child to the new location, which is fine in concept, but
> again messes up the animation because for some reason the actual
> drawing of the last frame of the animation hasn't finished by the time
> onAnimationEnd() is called. This causes the animation to go awry at
> the very end. What's happening in my case is if I layout the animated
> view to its new location in onAnimationEnd, the last step of the
> animation is being applied to the new layout, so the view looks like
> it is jumping around the screen. I tried a handler with no delay, and
> that didn't work either. Using a handler with a delayed message to
> accomplish the new layout works but is such a hack that I worry it may
> not work correctly on another piece of hardware.
>
> I could accomplish the animation by taking out the TranslateAnimation
> and instead do a manual animation, and in the manual one, change the
> layout of the view gradually (instead of transforming the matrix of
> the canvas) but that's a lot of work and error-prone.
>
> Any ideas? Are there tools I can use (besides manual application of
> Handler.sendMessageDelayed()) to accomplish an animation that actually
> re-lays out the view on each iteration instead of altering the canvas
> matrix?
--~--~-~--~~~---~--~~
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] Animation of a View

2009-09-09 Thread Eddified

I understand that animating a View using startAnimation() with a
TranslateAnimation object really just applies a transform on the
canvas that is being drawn on. In my case, the problems with this are:
a) sometimes I need to call bringChildToFront() (for a different View)
on the ViewGroup during the animation, which messes up the animation
because it triggers a requestLayout on all children, which in turn re-
lays out the child being animated... which messes up the continuity of
the animation. Perhaps causing a layout on the child being animated
isn't supposed to mess up animations, but it seems to be in my case.
b) after the animation (using an AnimationListener), I need to re-
layout the child to the new location, which is fine in concept, but
again messes up the animation because for some reason the actual
drawing of the last frame of the animation hasn't finished by the time
onAnimationEnd() is called. This causes the animation to go awry at
the very end. What's happening in my case is if I layout the animated
view to its new location in onAnimationEnd, the last step of the
animation is being applied to the new layout, so the view looks like
it is jumping around the screen. I tried a handler with no delay, and
that didn't work either. Using a handler with a delayed message to
accomplish the new layout works but is such a hack that I worry it may
not work correctly on another piece of hardware.

I could accomplish the animation by taking out the TranslateAnimation
and instead do a manual animation, and in the manual one, change the
layout of the view gradually (instead of transforming the matrix of
the canvas) but that's a lot of work and error-prone.

Any ideas? Are there tools I can use (besides manual application of
Handler.sendMessageDelayed()) to accomplish an animation that actually
re-lays out the view on each iteration instead of altering the canvas
matrix?
--~--~-~--~~~---~--~~
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] Mediastore thumbnail refresh

2009-09-09 Thread Christine

I use the image_capture intent to take a picture. But when I
subsequently access the gallery from within my app, the picture
doesn't show up. Apparently the thumbnails aren't refreshed in the
mean time? How can I force a refresh of the gallery thumbnails? I
couldn't find a method to do so - though I may have overlooked it.

--~--~-~--~~~---~--~~
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: Best practices for handling passwords/keys in open source projects?

2009-09-09 Thread Mark Murphy

Eric Mill wrote:
> In my app, I'm taking advantage of a web-based API (the Sunlight Labs
> API) that requires an API Key.  The project is also open source,
> hosted on Github. I want to avoid committing my API key into the
> codebase.
> 
> I'd be fine with creating some other .xml file of special string
> values, and git-ignoring that file (while providing a .xml.example
> file to copy into its place), but I don't know the best way of doing
> that with the Android SDK.
> 
> Any suggestions?

Total brainstorm, never tried this, your kilometerage may vary, etc. It
also assumes you're using Ant...

Step #1: Put the layout file containing the MapView element that needs
the API key somewhere other than res/layout/ (e.g., make a
layout-template/ directory and put it there).

Step #2: Create an Ant target that reads in a property file and uses
 and  tasks to "paste" the API key out of the
property file into a copy of the layout you make in the proper spot
(e.g., copy from layout-template/ to res/layout/ and then paste in the key).

Step #3: git-ignore the post-API-key edition of the layout file and your
property file.

Step #4: Possibly have your Ant target turn around and call some other
target (e.g., the debug target).

Side benefit of this: you can have two targets and two property files,
one for debug and one for production.

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

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

--~--~-~--~~~---~--~~
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] any update on ADC 2?

2009-09-09 Thread parchira tech

Is there any places we can view the submission list? has it begun to
judge?

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] Best practices for handling passwords/keys in open source projects?

2009-09-09 Thread Eric Mill

In my app, I'm taking advantage of a web-based API (the Sunlight Labs
API) that requires an API Key.  The project is also open source,
hosted on Github. I want to avoid committing my API key into the
codebase.

I'd be fine with creating some other .xml file of special string
values, and git-ignoring that file (while providing a .xml.example
file to copy into its place), but I don't know the best way of doing
that with the Android SDK.

Any suggestions?

-- Eric
--~--~-~--~~~---~--~~
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: can't bind to a local service.

2009-09-09 Thread sdphil

egads!  that was it (well, kinda)

I had it in there, but I had it as remote --
 android:process=":remote"

thanks!

On Sep 9, 12:41 pm, Dianne Hackborn  wrote:
> Did you publish the service in your manifest?
>
>
>
> On Wed, Sep 9, 2009 at 11:37 AM, sdphil  wrote:
>
> > I have the following base activity.
>
> > public class BaseActivity extends Activity
> > ...
> > ...
> > ... onCreate(...) {
> >        this.bindService(new Intent(BaseActivity.this,
> > LocalService.class), serviceConn, Context.BIND_AUTO_CREATE);
> >    }
> > ...
> >    private ServiceConnection serviceConn = new ServiceConnection() {
> >               �...@override
> >                public void onServiceConnected(ComponentName name, IBinder
> > service)
> > {
> >                        LocalService.LocalBinder binder =
> > (LocalService.LocalBinder)
> > service;
> >                        service = binder.getService();
> >                }
> > ...
> >    };
>
> > A derived activity fails on the call to cast a binder --
>
> > LocalService.LocalBinder binder = (LocalService.LocalBinder) service;
>
> > fails with this on the call stack --
>
> > InvocationTargetException.(Throwable) line: 56
> > ActivityThread.main(String[]) line: 3948
>
> > what am I doing wrong?
>
> > tia.
>
> --
> 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: Deep sleep behaviour

2009-09-09 Thread Dianne Hackborn
On Wed, Sep 9, 2009 at 9:45 AM, Mark Murphy  wrote:

> Dianne Hackborn wrote:
> > For socket-level
> > communication, you will wake up when you are receiving data.
> Doesn't the WiFi radio get turned off, though, when the device is asleep?
>

It may.  The device will always keep a data connection, but unless you hold
a wifi lock it would like to fall back to the cell network since that takes
significantly less power.

-- 
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: can't bind to a local service.

2009-09-09 Thread Dianne Hackborn
Did you publish the service in your manifest?

On Wed, Sep 9, 2009 at 11:37 AM, sdphil  wrote:

>
> I have the following base activity.
>
> public class BaseActivity extends Activity
> ...
> ...
> ... onCreate(...) {
>this.bindService(new Intent(BaseActivity.this,
> LocalService.class), serviceConn, Context.BIND_AUTO_CREATE);
>}
> ...
>private ServiceConnection serviceConn = new ServiceConnection() {
>@Override
>public void onServiceConnected(ComponentName name, IBinder
> service)
> {
>LocalService.LocalBinder binder =
> (LocalService.LocalBinder)
> service;
>service = binder.getService();
>}
> ...
>};
>
> A derived activity fails on the call to cast a binder --
>
> LocalService.LocalBinder binder = (LocalService.LocalBinder) service;
>
> fails with this on the call stack --
>
> InvocationTargetException.(Throwable) line: 56
> ActivityThread.main(String[]) line: 3948
>
> what am I doing wrong?
>
> tia.
> >
>


-- 
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: Is it possible to use the accelerometer in a background service?

2009-09-09 Thread Dianne Hackborn
There is no need to use getBaseContext(); Service is itself a Context.

On Wed, Sep 9, 2009 at 10:41 AM, Mike Collins wrote:

>
>
> my service uses "getBaseContext()", seems to work just fine.  Don't
> use it for
> GPS but we do use it for many other things.
>
>  mike
>
>
> On Sep 9, 6:57 am, John Smith  wrote:
> > It seems trivial to use GPS in a background service, but how can you
> > do the same with the accelerometer?
> >
> > Everything I've tried seems to require a context, but a background
> > service doesn't have a context?
> >
>


-- 
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: MyTouch Lag Problems

2009-09-09 Thread Dianne Hackborn
Yep, this is the current recommendation.  In Eclair the system should be
throttling event delivery to not more than 60/second, so this becomes a
little less important (and the historical data more important).

On Wed, Sep 9, 2009 at 12:07 PM, Robert Green  wrote:

>
> Mike, here's something to try:
>
> When handling motion events, process all of the historical data in
> order as if it's receiving those events like normal,
> then:  Sleep 16 or 32 ms or so.  You'll still receive all of the
> important stuff as historical data but you won't be flooded with
> events.  You'll be effectively limiting the number of events that can
> come in to 60 or 30 per second.  If you run another thread that
> animates or does anything graphically, you'll notice that because of
> the little bit of sleep on the UI thread, your game thread will
> continue running smoothly instead of getting chopped up from having to
> share so much CPU.
>
> I'm not sure if Dianne would recommend sleeping like that, but it was
> recommended by a speaker at Google IO for game performance and my
> tests showed that it is very helpful in situations where moving-touch
> processing is causing lags.
>
> On Sep 9, 12:03 pm, Mike  wrote:
> > Thanks Dianne!
> >
> > That might explain why, if I swipe my finger quickly over 3 or more
> > letters, that it sometimes won't register the ones in the middle.  I
> > will have a look at making use of the historical points to see if that
> > helps fix the problem.
> >
> > Regards,
> >
> > - Mike
> >
> > On Sep 9, 10:08 am, Dianne Hackborn  wrote:
> >
> > > Another thing you should probably consider -- the MotionEvent may
> contain
> > > more than one movement, as part of the historical data.  So, especially
> if
> > > you have a little overhead in handling events, if someone moves their
> finger
> > > quickly you may get a single motion event with some historical points
> inside
> > > of a box but the final one outside.
> >
> > > On Wed, Sep 9, 2009 at 8:42 AM, Mike 
> wrote:
> >
> > > > Hey there.  I wanted to follow up and say that I haven't heard back
> > > > from any of my users that have the myTouch and toggling/turning off
> > > > the location services to see if it made a difference.
> >
> > > > However, I came across something in my code which may be at least
> part
> > > > of the problem.  In WordUp! the user spells out words by tracing
> their
> > > > finger across the letters which are arranged on a square grid.
> >
> > > > I handle onTouchEvent(MotionEvent event) calls to my view to
> determine
> > > > when the user first starts selecting, when they are dragging their
> > > > finger, and when the let up to do the appropriate drawing and
> > > > recording of letters during this gesture.
> >
> > > > One thing I had not taken into consideration is the large number of
> > > > onTouchEvent calls I would get while the user is moving their finger
> > > > while it is pressed down.  I only needed to care about when their
> > > > finger enters the bounds of a new cube, and record and invalidate a
> > > > dirty rect to redraw that portion of the screen.  However, I was
> doing
> > > > this work on every call to onTouchEvent which was invalidating my
> > > > dirty rect many more times than it needed to.
> >
> > > > Once I accounted for this, the drag gesture is a lot more responsive.
> > > > I haven't confirmed that this fix addresses the lag issues people
> have
> > > > seen using my game on the myTouch, but I'm very curious to find out.
> >
> > > > Regards,
> >
> > > > - Mike
> >
> > > > On Aug 27, 1:22 pm, Mike  wrote:
> > > > > Thanks everyone for your input.  I'm asking some of my users to do
> > > > > what Dianne suggested with toggling the location services off and
> on
> > > > > to see if that is enough to alleviate this problem.  I'll let you
> know
> > > > > what I find out.
> >
> > > > > Regards,
> >
> > > > > - Mike
> >
> > > > > On Aug 27, 1:20 pm, Hong  wrote:
> >
> > > > > > Thanks for the clarification!
> >
> > > > > > On Thu, Aug 27, 2009 at 3:03 PM, Dianne Hackborn <
> hack...@android.com
> > > > >wrote:
> >
> > > > > > > Next feature release.  I don't know what announcements have
> been made
> > > > about
> > > > > > > it, so I'm not in a position to say anything.
> >
> > > --
> > > 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 thi

[android-developers] Re: Unable to write text file to sdcard on physical G1 device

2009-09-09 Thread androiduser mobile

I got it working with a permission change in the manifest file. I
added "WRITE_EXTERNAL_STORAGE" and it worked like a gem :)).


On Sep 9, 12:13 pm, Chris Stratton  wrote:
> On Jul 17, 6:24 pm, doubleminus  wrote:
>
> > Is it a permissions issue?  Trying to "touch" the sdcard via adb shell
> > gives me a "permission denied" message...
>
> FYI there's no "touch" command in the shell or /system/bin and the
> shell apparently considers "permission denied" to be a good substitute
> for "[command] not found"
>
> but you can "cat > /sdcard/testfile" and then ^D
--~--~-~--~~~---~--~~
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: MyTouch Lag Problems

2009-09-09 Thread Mike

Thanks Robert,

I'll have to play around with this idea and see what works.

- Mike

On Sep 9, 1:07 pm, Robert Green  wrote:
> Mike, here's something to try:
>
> When handling motion events, process all of the historical data in
> order as if it's receiving those events like normal,
> then:  Sleep 16 or 32 ms or so.  You'll still receive all of the
> important stuff as historical data but you won't be flooded with
> events.  You'll be effectively limiting the number of events that can
> come in to 60 or 30 per second.  If you run another thread that
> animates or does anything graphically, you'll notice that because of
> the little bit of sleep on the UI thread, your game thread will
> continue running smoothly instead of getting chopped up from having to
> share so much CPU.
>
> I'm not sure if Dianne would recommend sleeping like that, but it was
> recommended by a speaker at Google IO for game performance and my
> tests showed that it is very helpful in situations where moving-touch
> processing is causing lags.
>
> On Sep 9, 12:03 pm, Mike  wrote:
>
> > Thanks Dianne!
>
> > That might explain why, if I swipe my finger quickly over 3 or more
> > letters, that it sometimes won't register the ones in the middle.  I
> > will have a look at making use of the historical points to see if that
> > helps fix the problem.
>
> > Regards,
>
> > - Mike
>
> > On Sep 9, 10:08 am, Dianne Hackborn  wrote:
>
> > > Another thing you should probably consider -- the MotionEvent may contain
> > > more than one movement, as part of the historical data.  So, especially if
> > > you have a little overhead in handling events, if someone moves their 
> > > finger
> > > quickly you may get a single motion event with some historical points 
> > > inside
> > > of a box but the final one outside.
>
> > > On Wed, Sep 9, 2009 at 8:42 AM, Mike  
> > > wrote:
>
> > > > Hey there.  I wanted to follow up and say that I haven't heard back
> > > > from any of my users that have the myTouch and toggling/turning off
> > > > the location services to see if it made a difference.
>
> > > > However, I came across something in my code which may be at least part
> > > > of the problem.  In WordUp! the user spells out words by tracing their
> > > > finger across the letters which are arranged on a square grid.
>
> > > > I handle onTouchEvent(MotionEvent event) calls to my view to determine
> > > > when the user first starts selecting, when they are dragging their
> > > > finger, and when the let up to do the appropriate drawing and
> > > > recording of letters during this gesture.
>
> > > > One thing I had not taken into consideration is the large number of
> > > > onTouchEvent calls I would get while the user is moving their finger
> > > > while it is pressed down.  I only needed to care about when their
> > > > finger enters the bounds of a new cube, and record and invalidate a
> > > > dirty rect to redraw that portion of the screen.  However, I was doing
> > > > this work on every call to onTouchEvent which was invalidating my
> > > > dirty rect many more times than it needed to.
>
> > > > Once I accounted for this, the drag gesture is a lot more responsive.
> > > > I haven't confirmed that this fix addresses the lag issues people have
> > > > seen using my game on the myTouch, but I'm very curious to find out.
>
> > > > Regards,
>
> > > > - Mike
>
> > > > On Aug 27, 1:22 pm, Mike  wrote:
> > > > > Thanks everyone for your input.  I'm asking some of my users to do
> > > > > what Dianne suggested with toggling the location services off and on
> > > > > to see if that is enough to alleviate this problem.  I'll let you know
> > > > > what I find out.
>
> > > > > Regards,
>
> > > > > - Mike
>
> > > > > On Aug 27, 1:20 pm, Hong  wrote:
>
> > > > > > Thanks for the clarification!
>
> > > > > > On Thu, Aug 27, 2009 at 3:03 PM, Dianne Hackborn 
> > > > > >  > > > >wrote:
>
> > > > > > > Next feature release.  I don't know what announcements have been 
> > > > > > > made
> > > > about
> > > > > > > it, so I'm not in a position to say anything.
>
> > > --
> > > 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: what services are available at the API level?

2009-09-09 Thread Andy Droid

Yeah, that questions too vague.  The link helped, though.

On Sep 9, 10:41 am, Mark Murphy  wrote:
> Andy Droid wrote:
> > That's a good point.  In addition to what I mentioned, I guess I'm
> > really interested in ALL the API's, regardless of how they are
> > implemented.  Are all API's documented in one place?
>
> http://developer.android.com/reference/packages.html
>
> But I suspect you've already been there, so I think I don't understand
> what you're asking.
>
> --
> 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: Unable to write text file to sdcard on physical G1 device

2009-09-09 Thread Chris Stratton

On Jul 17, 6:24 pm, doubleminus  wrote:
> Is it a permissions issue?  Trying to "touch" the sdcard via adb shell
> gives me a "permission denied" message...

FYI there's no "touch" command in the shell or /system/bin and the
shell apparently considers "permission denied" to be a good substitute
for "[command] not found"

but you can "cat > /sdcard/testfile" and then ^D

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

2009-09-09 Thread Engin Arslan

Hi, i am capturing video with the code below. But there is problem on
video quality, that is, when I capture video with applicaiton I wrote
its quality is not as well as video quality of telepohnes' which is
recorded by Camcorder.

public CamcorderPreview(Context context, AttributeSet attrs) {
super(context, attrs);
holder = getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
 recorder.setVideoSize(352,288);
 createVideoPath();
 recorder.setOutputFile(mCameraVideoFilename);
  recorder.setVideoEncoder
(MediaRecorder.VideoEncoder.H263);
  recorder.setAudioEncoder
(MediaRecorder.AudioEncoder.AMR_NB);

 recorder.setPreviewDisplay(holder.getSurface());
}
--~--~-~--~~~---~--~~
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: MyTouch Lag Problems

2009-09-09 Thread Robert Green

Mike, here's something to try:

When handling motion events, process all of the historical data in
order as if it's receiving those events like normal,
then:  Sleep 16 or 32 ms or so.  You'll still receive all of the
important stuff as historical data but you won't be flooded with
events.  You'll be effectively limiting the number of events that can
come in to 60 or 30 per second.  If you run another thread that
animates or does anything graphically, you'll notice that because of
the little bit of sleep on the UI thread, your game thread will
continue running smoothly instead of getting chopped up from having to
share so much CPU.

I'm not sure if Dianne would recommend sleeping like that, but it was
recommended by a speaker at Google IO for game performance and my
tests showed that it is very helpful in situations where moving-touch
processing is causing lags.

On Sep 9, 12:03 pm, Mike  wrote:
> Thanks Dianne!
>
> That might explain why, if I swipe my finger quickly over 3 or more
> letters, that it sometimes won't register the ones in the middle.  I
> will have a look at making use of the historical points to see if that
> helps fix the problem.
>
> Regards,
>
> - Mike
>
> On Sep 9, 10:08 am, Dianne Hackborn  wrote:
>
> > Another thing you should probably consider -- the MotionEvent may contain
> > more than one movement, as part of the historical data.  So, especially if
> > you have a little overhead in handling events, if someone moves their finger
> > quickly you may get a single motion event with some historical points inside
> > of a box but the final one outside.
>
> > On Wed, Sep 9, 2009 at 8:42 AM, Mike  wrote:
>
> > > Hey there.  I wanted to follow up and say that I haven't heard back
> > > from any of my users that have the myTouch and toggling/turning off
> > > the location services to see if it made a difference.
>
> > > However, I came across something in my code which may be at least part
> > > of the problem.  In WordUp! the user spells out words by tracing their
> > > finger across the letters which are arranged on a square grid.
>
> > > I handle onTouchEvent(MotionEvent event) calls to my view to determine
> > > when the user first starts selecting, when they are dragging their
> > > finger, and when the let up to do the appropriate drawing and
> > > recording of letters during this gesture.
>
> > > One thing I had not taken into consideration is the large number of
> > > onTouchEvent calls I would get while the user is moving their finger
> > > while it is pressed down.  I only needed to care about when their
> > > finger enters the bounds of a new cube, and record and invalidate a
> > > dirty rect to redraw that portion of the screen.  However, I was doing
> > > this work on every call to onTouchEvent which was invalidating my
> > > dirty rect many more times than it needed to.
>
> > > Once I accounted for this, the drag gesture is a lot more responsive.
> > > I haven't confirmed that this fix addresses the lag issues people have
> > > seen using my game on the myTouch, but I'm very curious to find out.
>
> > > Regards,
>
> > > - Mike
>
> > > On Aug 27, 1:22 pm, Mike  wrote:
> > > > Thanks everyone for your input.  I'm asking some of my users to do
> > > > what Dianne suggested with toggling the location services off and on
> > > > to see if that is enough to alleviate this problem.  I'll let you know
> > > > what I find out.
>
> > > > Regards,
>
> > > > - Mike
>
> > > > On Aug 27, 1:20 pm, Hong  wrote:
>
> > > > > Thanks for the clarification!
>
> > > > > On Thu, Aug 27, 2009 at 3:03 PM, Dianne Hackborn  > > >wrote:
>
> > > > > > Next feature release.  I don't know what announcements have been 
> > > > > > made
> > > about
> > > > > > it, so I'm not in a position to say anything.
>
> > --
> > 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: Tracking down libdvm crash

2009-09-09 Thread DaveG

On Sep 8, 1:25 pm, fadden  wrote:
> On Sep 8, 12:26 pm, DaveG  wrote:
>
> > My app is running into the following crash and I'm having a hard time
> > diagnosing it. We have multiple background threads (including a couple
> > pthreads started via JNI that are making calls back up to Java
> > occasionally), but none of them are reporting errors . Any suggestions
> > on how to go about isolating this? There are no symbols in libdvm, so
> > I've been unable to figure out where the stack trace points. This has
> > happened 3 times so far, with the same stack trace each time.
>
> Note that libraries with symbols are never installed on the device
> itself.  They're generated and stored in a separate directory in the
> "out" directory, and the tools pull them from there.

Ah, yeah, forgot about building it myself, duh. Ok, with symbols, it
becomes
clear that System.gc() is running (triggered by a JNI call up to Java)
and
is barfing on something it finds, likely because of an invalid
DeleteLocalRef()
call in my C code somewhere. That should be easy enough to find.

Thanks,
Dave Golombek
Flexilis, Inc
www.flexilis.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: Unable to write text file to sdcard on physical G1 device

2009-09-09 Thread androiduser mobile

Hi doubleminus,

Did you resolve this issue? Can you please provide me the solution. I
am stuck with this issue.

Thanks,
Android user



On Aug 17, 7:15 am, Dany BREARD  wrote:
> Hi
>
> I have the same issue but I can't change my /sdcard permission.
>
> I have windows xp, I try to change /sdcard  permission as this url:
>
> http://www.vulgarisation-informatique.com/droits-acces.php
>
> but permission don't change.
>
> please help me how can I change this permisson in windows xp ?
>
> It's look like:
>
> +datapermissions : drwxrwx--x
> +sdcardpermissions : d-"
> +system   permissions : drwxr-xr-
>
> On Jul 18, 4:40 am, ekwang  wrote:
>
>
>
> > You can use ddms tool for verify whether sdcard was inserted or not.
>
> > #android-sdk-windows-1.5_r2\tools\ddms
> > select Device -FileExplore
>
> > below is correct permissions value.
>
> > +data   permissions : drwxrwx--x
> > +sdcardpermissions : drwxrwxrwx
> > +system   permissions : drwxr-xr-x
>
> > If sdcard permissions was look "d-"
> > It means sdcard is not inserted.
>
> > On Jul 18, 7:24 am, doubleminus  wrote:
>
> > > Is it a permissions issue?  Trying to "touch" the sdcard via adb shell
> > > gives me a "permissiondenied" message...
>
> > > On Jul 16, 10:49 pm, doubleminus  wrote:
>
> > > > Right now, file_name is just set to "12880"+"-"+po_number.getText
> > > > ().toString();
>
> > > > When I put "/sdcard/" (or "sdcard/" into myfilepath I get
> > > > IOException: Parent directory offiledoes not exist: /sdcard/sdcard/
> > > > 12880-231
>
> > > > If I get rid of the sdcard/ prefix, I get this exception:
> > > > FileNotFoundException: /data/data/com.heroku.blacksky/files/12880-222
>
> > > > Here's the newfilecreation code, based on everyone's suggestions:
> > > >  file1 = newFile(Environment.getExternalStorageDirectory(),
> > > > file_name);
> > > >   file1.createNewFile();
> > > >   file_out =  new FileOutputStream(file1);
> > > >   buf = new BufferedOutputStream(file_out);
> > > >   out_stream = new OutputStreamWriter(buf);
>
> > > > Please let me know your thoughts. I'm still quite confused by this.
>
> > > > double
>
> > > > On Jul 16, 12:12 am, Kaj Bjurman  wrote:
>
> > > > > I can't see that you are using file1 after that line. You are using
> > > > > file_name.
>
> > > > > On 14 Juli, 18:09, doubleminus  wrote:
>
> > > > > > Isn't that what the first lines of code do?
>
> > > > > >Filefile1 = newFile(Environment.getExternalStorageDirectory(),
> > > > > > file_name);
>
> > > > > > On Jul 13, 3:02 pm, Streets Of Boston  
> > > > > > wrote:
>
> > > > > > > Simple. :-)
> > > > > > > The error says that thefiledoes not exist... that means you should
> > > > > > > create it.
> > > > > > > UseFile#createNewFile().
>
> > > > > > > On Jul 13, 5:53 pm, doubleminus  wrote:
>
> > > > > > > > Romain is?  I don't understand. Is there something I should be 
> > > > > > > > doing
> > > > > > > > to avoid filenotfound exception?
>
> > > > > > > > On Jul 13, 12:40 am, 郑伟  wrote:
>
> > > > > > > > > You are right...
>
> > > > > > > > > > Date: Sun, 12 Jul 2009 21:29:28 -0700
> > > > > > > > > > Subject: [android-developers] Re:Unabletowritetextfileto 
> > > > > > > > > > sdcard on  physical G1 device
> > > > > > > > > > From: romain...@google.com
> > > > > > > > > > To: android-developers@googlegroups.com
>
> > > > > > > > > > Hi,
>
> > > > > > > > > > Instead of:
>
> > > > > > > > > > > FileOutputStream file_out = openFileOutput
> > > > > > > > > > > (file_name,MODE_WORLD_READABLE);
>
> > > > > > > > > > Just use:
>
> > > > > > > > > > FileOutputStream file_out = new FileOutputStream(file_name);
>
> > > > > > > > > > This should work.
>
> > > > > > > > > > On Sun, Jul 12, 2009 at 8:10 PM, 
> > > > > > > > > > doubleminus wrote:
>
> > > > > > > > > > > I need towritea fairly simple .csvfileto the device's 
> > > > > > > > > > > sdcard (so
> > > > > > > > > > > it can then be emailed via Intent). The below code does 
> > > > > > > > > > > notwritethe
> > > > > > > > > > >file.
>
> > > > > > > > > > >Filefile1 = 
> > > > > > > > > > >newFile(Environment.getExternalStorageDirectory(),
> > > > > > > > > > > file_name);
> > > > > > > > > > > FileOutputStream file_out = openFileOutput
> > > > > > > > > > > (file_name,MODE_WORLD_READABLE);
> > > > > > > > > > > BufferedOutputStream buf = new 
> > > > > > > > > > > BufferedOutputStream(file_out);
> > > > > > > > > > > OutputStreamWriter out_stream = new 
> > > > > > > > > > > OutputStreamWriter(buf);
>
> > > > > > > > > > >  //writefields in first row of spreadsheet then a 
> > > > > > > > > > > new line
> > > > > > > > > > >  for (int i = 0; i < FIELDS.length; i++)
> > > > > > > > > > >  {
> > > > > > > > > > > if (i != FIELDS.length - 1)
> > > > > > > > > > >out_stream.write(FIELDS[i] + ",");
> > > > > > > > > > > else
> > > > > > > > > > >out_stream.write(FIELDS[i]);
> > > > 

[android-developers] Re: Is it possible to use the accelerometer in a background service?

2009-09-09 Thread dadical

I register a listener to orientation sensor from within a background
service with no trouble.  Perhaps the following code may help.  These
methods are called from my service's onCreate and onDestroy methods:

private void startMonitoring(){
SensorManager lMgr = (SensorManager) getSystemService
(Context.SENSOR_SERVICE);

try{
lMgr.unregisterListener(this);
} catch(Exception e){
Log.d(ScreeblService.class.getSimpleName(), 
e.toString());
}

List lSensorList = lMgr.getSensorList
(Sensor.TYPE_ORIENTATION);
if(lSensorList == null || lSensorList.size() == 0){
throw new RuntimeException("Orientation sensor not 
available!");
}

// assumes that this class implements
SensorEventListener
lMgr.registerListener( this, lSensorList.get(0),
SensorManager.SENSOR_DELAY_NORMAL );

}

private void stopMonitoring(){
SensorManager lMgr = (SensorManager) getSystemService
(Context.SENSOR_SERVICE);

try{
lMgr.unregisterListener(this);
} catch(Exception e){
Log.d(ScreeblService.class.getSimpleName(), 
e.toString());
}

}


On Sep 9, 1:41 pm, Mike Collins  wrote:
> my service uses "getBaseContext()", seems to work just fine.  Don't
> use it for
> GPS but we do use it for many other things.
>
>   mike
>
> On Sep 9, 6:57 am, John Smith  wrote:
>
>
>
> > It seems trivial to use GPS in a background service, but how can you
> > do the same with the accelerometer?
>
> > Everything I've tried seems to require a context, but a background
> > service doesn't have a context?- 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: Detecting when launched by an Alias

2009-09-09 Thread modaddy

Bumping one time...

On Sep 2, 1:46 pm, modaddy  wrote:
> Hello,
>
> I'm trying to figure out how my Activity can detect if it was launched
> by analiasas opposed to by the main icon.  Is it possible to do
> this?
>
> e.g. In my manifest file, I have:
>      android:icon="@drawable/icon"
> android:targetActivity=".multipleEntryPointTestActivity">
>                         
>                                  android:name="android.intent.action.MAIN" />
>                                  android:name="android.intent.category.LAUNCHER" />
>                         
>     
>
>  android:icon="@drawable/icon"
> android:targetActivity=".multipleEntryPointTestActivity">
>                         
>                                  android:name="android.intent.action.MAIN" />
>                                  android:name="android.intent.category.LAUNCHER" />
>                         
> 
>
> alias1 and alias2 appear as expected in the Launcher, but I don't see
> any way in multipleEntryPointTestActivity to tell which of these icons
> launched the application.  Any pointers?
>
> Thanks,
> Michael
--~--~-~--~~~---~--~~
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] wifi RA certificate issue

2009-09-09 Thread Adam

hi all,
Have you notice that user is not able to import WIFI RA certificate to
android. i'm using HTC Hero and i was really surprised when i failed
to add new certificate to my wifi connection.  it is possible even on
symbian so... you can edit advanced settings and then select add new
certificate, but than nothing happens like there would be only todo
comment block in code... I hope somebody will fix it because i don't
want to root my phone in order to have this functionality 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] how to get stack of activities?

2009-09-09 Thread Marco Aurelio

Hi all,

I'll explain why:

Assuming that my activity stack is ABC. (activity A is running and the
next activity is B).

I have to write a code that performs the following action: if A dies
and the next activity to be executed is B, then recreate B. If the
next activity is not B, do nothing.

This is the reason why I want to know whether there is a way to see
what is on the activity stack.

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] can't bind to a local service.

2009-09-09 Thread sdphil

I have the following base activity.

public class BaseActivity extends Activity
...
...
... onCreate(...) {
this.bindService(new Intent(BaseActivity.this,
LocalService.class), serviceConn, Context.BIND_AUTO_CREATE);
}
...
private ServiceConnection serviceConn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder 
service)
{
LocalService.LocalBinder binder = 
(LocalService.LocalBinder)
service;
service = binder.getService();
}
...
};

A derived activity fails on the call to cast a binder --

LocalService.LocalBinder binder = (LocalService.LocalBinder) service;

fails with this on the call stack --

InvocationTargetException.(Throwable) line: 56
ActivityThread.main(String[]) line: 3948

what am I doing wrong?

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] How to listen for any change in the contact database

2009-09-09 Thread hap 497

Hi,

I am trying to listen for any change in the contact database.

So I create my contentObserver which is a child class of ContentObserver:

 private class MyContentObserver extends ContentObserver {

public MyContentObserver() {
super(null);
}

@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
System.out.println (" Calling onChange" );
}

}

MyContentObserver contentObserver = new MyContentObserver();
context.getContentResolver().registerContentObserver
(People.CONTENT_URI, true, contentObserver);


But When I use 'EditContactActivity' to change the contact database,
My onChange function does not get called.

--~--~-~--~~~---~--~~
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 can I get current Activity object in Instrumentation object ????

2009-09-09 Thread Brett Chabot

It sounds like android.app.Instrumentation.ActivityMonitor might help.

See 
http://developer.android.com/reference/android/app/Instrumentation.ActivityMonitor.html

Brett.

On Wed, Sep 9, 2009 at 1:14 AM, HandsomeboyIT  wrote:
>
> I want to do some automated testcase with Instrumentation . Suggest
> that my AUT has 2 Activity. After clicking the button in ther first
> Activity, the second one will be shown  with new content base on what
> we enter in the first Activity.)
> Instrumentation provides us the function called startActivitySync()
> and return the Activity object for processing...
> My question is how we can get the pointer of the second Activity after
> the it is shown by clicking the button on the first activity.?
>
> 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: J-unit testing issues

2009-09-09 Thread Brett Chabot

Comments below.

On Tue, Sep 8, 2009 at 1:12 AM, jrichards1...@googlemail.com
 wrote:
>
> Hi, i am having two issues when doing Junit testing on my code. the
> first issue is i cant seem to unit test a private method or class and
> was wondering if its possible to do so.

No its not possible. The same access rules that apply to application
code will apply to test code.

>
> the second issue is that i have setup a seperate android project for
> doing all the testing and have just added the main project into its
> build path so i can call methods from the main android project i am
> testing on. Whenever i call something from the main project ie Myclass
> myclass = new Myclass(); it fails saying that the Test Run failed with
> a java.lang.Verify error

I believe one cause of VerifyError is that the class you are trying to
load is not in the current process's runtime classpath. In order for
your test app to be able to access the main app's classes at runtime,
you need to specify a instrumentation tag in your test app's
AndroidManifest.xml. Ensure the "targetPackage" is set to the main
application package.

See the samples/ApiDemos/tests/AndroidManifest.xml for an example. ie







>
> i am simply creating a new class object from my main project into my
> AndroidTestCase class so im not quite sure what the issue is.
>
> i am basicly having the exact same issue as someone in this link
> http://dtmilano.blogspot.com/2009/07/android-testing-on-android-platform_4442.html
> who has posted a comment about it
>
> Here below is the original comment made by someone with the same issue
> i have.
>
> [quote]
>
> hey diego, i'm trying to create a unit test by following your
> tutorial. I've arrived in which i created a test method for one of my
> class (called MyClass for example) which resides in my main package
> (say, com.package.main). And yes, I've put my main project in the test
> build path configuration.
>
> And then, I tried to create the class in one of my test case in a
> usual manner of:
>
> MyClass myClass = new MyClass()
>
> And then I tried to run the test project and it always gives Test run
> failed messages. This happens eveytime I wanted to instantiate any
> class that resides in my main project. Can you help me on this? Thanks
> in advance :).
>
> [/quote]
>
> Anyways, thanks for your time in reading this and im hoping someone
> here can help me as i really want to create a seperate project with
> all my Testcase's and TestSuits instead of including them in the main
> project. I also do not want to make my private class and methods
> public just for Unit testing.
>
> Thanks again and looking forward to some of your advice.
>
> >
>

--~--~-~--~~~---~--~~
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: GC and releasing physical memory

2009-09-09 Thread skink



On Sep 9, 8:02 pm, Dianne Hackborn  wrote:
> The current garbage
> collector does no compaction, but it will release pages inside of the heap
> that are free.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

thanks Dianne for your prompt reply

how gc knows what page is free?
it needs to iterate over every object to check if its in that page
boudnary? it'd be expensive task...

thanks
pskink

--~--~-~--~~~---~--~~
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: GC and releasing physical memory

2009-09-09 Thread Dianne Hackborn
It all depends on how the objects appear in the heap.  The current garbage
collector does no compaction, but it will release pages inside of the heap
that are free.

On Wed, Sep 9, 2009 at 10:51 AM, skink  wrote:

>
> hi,
>
> i dont know if i understand how gc releases physical memory
>
> lets assume that physical mem is divided into 4kB pages
>
> i allocate 2000 objects each 2kB long
>
> lets assume they are allocated one after another in physical memory
>
> then i release every even object 0, 2, 4 etc
>
> so i released 1000 objects x 2kB
>
> question: how many physical pages will be released to other processes?
>
> thanks
> pskink
> >
>


-- 
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] GC and releasing physical memory

2009-09-09 Thread skink

hi,

i dont know if i understand how gc releases physical memory

lets assume that physical mem is divided into 4kB pages

i allocate 2000 objects each 2kB long

lets assume they are allocated one after another in physical memory

then i release every even object 0, 2, 4 etc

so i released 1000 objects x 2kB

question: how many physical pages will be released to other processes?

thanks
pskink
--~--~-~--~~~---~--~~
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: Dialing IVR Systems, or sending DTMF tones after a call is made

2009-09-09 Thread Mark Ellul

Hi,

After studying the code and trying a few different ways to do this,
noting that in the Emulator the code works fine

I come to believe that its a HTC Hero Issue. Unforunately I do not
have a G1 to test on.

If anyone does have a G1 they could test the code let me know I will
send you the code.

Just to explain what is happening on the HTC Hero. When I try to send
it a number with comma's it removes them, even when I try to use ;ext=
to send the IVR commands it fails even though on the emulator it asks
me if I want to send the tones. I have tried ACTION_DIAL and
ACTION_CALL and both do the same thing, it starts to dial the number,
you hear the first tone come out of the speaker phone and then I see
this error below in the LogCat

09-09 19:33:45.721: ERROR/AudioService(63): Invalid routing action.
Node A2DP does not exist.

I have tried numbers i.e. without extra chars and it works, so the
code is fine.

I have encoded the hash as per this discussion

http://groups.google.com/group/android-developers/browse_thread/thread/e8904c82a2c4a333/d8452b707b38b20b?q=internal.telephony#d8452b707b38b20b

I couldn't find in the code where that error message "invalid routing
action" exists, but I see that in the AudioManager there is some code
to fix a bug that was in the eclair release, which talks about
MODE_INVALID. Not sure if I am off the scent here though.

Either way, I am not sure if this is a HTC Issue or a Android Issue.

If ANYONE has a G1 or HTC Hero and would be willing to test the code,
please let me know. ANY HELP would be appreciated

Regards

Mark

09-09 19:33:45.721: ERROR/AudioService(63): Invalid routing action.
Node A2DP does not exist.

On Sep 8, 3:47 pm, Mark Ellul  wrote:
> Hi
>
> Just to Add more Logging output
>
> This time from the adb device shell prompt, when I am running
>
> logcat -b radio
>
> D/GSM     (  118): [GSMConn] acquireWakeLock
> D/RILJ    (  118): [0828]> SET_MUTE false
> D/RILJ    (  118): [0829]> DIAL
> D/RILJ    (  118): [0828]< SET_MUTE
> D/RILJ    (  118): [UNSL]< UNSOL_RESPONSE_CALL_STATE_CHANGED
> D/RILJ    (  118): [0829]< DIAL
> D/RILJ    (  118): [0830]> SET_MUTE false
> D/RILJ    (  118): [0830]< SET_MUTE
> D/RILJ    (  118): [0831]> SET_MUTE false
> D/RILJ    (  118): [0832]> GET_CURRENT_CALLS
> D/RILJ    (  118): [0831]< SET_MUTE
> D/RILJ    (  118): [UNSL]< UNSOL_RESPONSE_CALL_STATE_CHANGED
> D/RILJ    (  118): [0832]< GET_CURRENT_CALLS
> [id=1,mo,DIALING,voice,norm,129,0,cli 1]
> D/RILJ    (  118): [0833]> SET_MUTE false
> D/RILJ    (  118): [0833]< SET_MUTE
> D/RILJ    (  118): [0834]> GET_CURRENT_CALLS
> D/RILJ    (  118): [0834]< GET_CURRENT_CALLS
> [id=1,mo,DIALING,voice,norm,129,0,cli 1]
> D/GSM     (  118): [GSMConn] update: parent=DIALING,
> hasNewParent=false, wasConnectingInOrOut=true, wasHolding=false,
> isConnectingInOrOut=true, changed=false
> D/RILJ    (  118): [0835]> SET_MUTE false
> D/RILJ    (  118): [0835]< SET_MUTE
> D/RILJ    (  118): [UNSL]< UNSOL_RESPONSE_CALL_STATE_CHANGED
> D/RILJ    (  118): [0836]> GET_CURRENT_CALLS
> D/RILJ    (  118): [UNSL]< UNSOL_RESPONSE_CALL_STATE_CHANGED
> D/RILJ    (  118): [0836]< GET_CURRENT_CALLS
> D/RILJ    (  118): [0837]> GET_CURRENT_CALLS
> D/RILJ    (  118): [0837]< GET_CURRENT_CALLS
> D/RILJ    (  118): [0838]> LAST_CALL_FAIL_CAUSE
> D/RILJ    (  118): [0838]< LAST_CALL_FAIL_CAUSE {65535}
> D/GSM     (  118): [GSMConn] onDisconnect: cause=NORMAL
> D/GSM     (  118): [GSMConn] releaseWakeLock
> D/GSM     (  118): [DataConnectionTracker] ***trySetupData due to
> 2GVoiceCallEnded
> D/GSM     (  118): [DataConnectionTracker]  trySetupData: Not ready
> for data:
> D/GSM     (  118): disableDataConnection=false
> D/GSM     (  118): noRetry=false
> D/GSM     (  118): isPowerSavingModeActivated=false
> D/GSM     (  118): dataState=IDLE
> D/GSM     (  118): gprsState=0
> D/GSM     (  118): sim=true
> D/GSM     (  118): UMTS=true
> D/GSM     (  118): phoneState=IDLE
> D/GSM     (  118): dataEnabled=false
> D/GSM     (  118): dataOnRoamingEnable=false
> D/GSM     (  118): [DataConnectionTracker] Clean up connection due to
> 2GVoiceCallEnded
> D/GSM     (  118): [DataConnection] Stop poll NetStat
> D/GSM     (  118): [DataConnectionTracker] setState: IDLE
> D/RILJ    (  118): [0839]> SET_MUTE false
> D/RILJ    (  118): [0839]< SET_MUTE
> D/RILJ    (  118): [0840]> SET_MUTE false
> D/RILJ    (  118): [0840]< SET_MUTE
> D/RILJ    (  118): [0841]> DTMF_STOP
> D/RILJ    (  118): [0841]< DTMF_STOP
> D/RILJ    (  118): [0841]< DTMF_STOP error:
> com.android.internal.telephony.gsm.CommandException: GENERIC_FAILURE
> D/RILJ    (  118): [0842]> DTMF_STOP
> D/RILJ    (  118): [0842]< DTMF_STOP
> D/RILJ    (  118): [0842]< DTMF_STOP error:
> com.android.internal.telephony.gsm.CommandException: GENERIC_FAILURE
>
> If you need more info please let me know.
>
> Regards
>
> Mark
>
> On Sep 8, 3:40 pm, Mark Ellul  wrote:
>
>
>
> > Hi
>
> > I have added more log information from the ddms tool, to see if this
> > helps...
>
> > 09

[android-developers] Re: onReceive not triggering for SEND / image

2009-09-09 Thread EnnaN

thanks :D

and progress is being made, hopefully no more of these bumps in the
road :D

n.

On Sep 9, 7:33 pm, Beth  wrote:
> Here is the nudge you wanted...
> Your intent filter needs to be set on an activity.  The code you
> posted shows it as a Broadcast Receiver.
> Change:
> 
> to
> 
> and move all your stuff from onRecieve to onCreate.  That should take
> you forward.
>
> Good luck!
>
> On Sep 9, 10:25 am, EnnaN  wrote:
>
> > and there we are. for future reference // other readers: i was looking
> > for the following line:
>
> > Intent i=getIntent();
>
> > n.
>
> > On Sep 9, 12:14 pm, EnnaN  wrote:
>
> > > I know i'm bumping this, but i really think it's something simple i've
> > > missed. Trying to avoid definitions i might be using incorrectly:
>
> > > This is what i have:
> > > An app that turns up in the "share" menu of the gallery.
> > > Selecting my app starts it as if you would start it normally
>
> > > This is what i don't have:
> > > A way to react to the image i was looking at: i do not know where to
> > > define code to do stuff with the picture.
>
> > > Just a small nudge in the right direction is enough hopefully,
> > > please? :D
>
> > > Nanne.
>
> > > On Sep 2, 1:51 pm, EnnaN  wrote:
>
> > > > Thanks!
> > > > THen i'm just confused about how to react to the intent -> at some
> > > > point the images i'm sharing should be triggering some sort of event,
> > > > so i can handle it. That's what i was trying to do with the receiver.
> > > > Could you point me how to have a functions that reacts as an event-
> > > > handler of the received 'SEND'?
>
> > > > Nanne.
>
> > > > On Sep 2, 8:52 am, Dianne Hackborn  wrote:
>
> > > > > SEND is an activity action.  All you need to do is have it in your 
> > > > > manifest
> > > > > for an activity, as you have shown, and you know it is working 
> > > > > because you
> > > > > see it in the share menu, and when you select your item in the share 
> > > > > menu
> > > > > your activity will be launched with the intent.  That is all there is 
> > > > > to
> > > > > it.  There is no broadcast receiver involved at all, anywhere.
>
> > > > > On Tue, Sep 1, 2009 at 11:42 PM, EnnaN  wrote:
>
> > > > > > FOr some more information: I did try to add the intent to an
> > > > > > "receiver" in the manifest XML on a tip i got, but this not only
> > > > > > didn't work to start my receiver class, it also removed the "share"
> > > > > > option from the image i was trying to do something with... So not so
> > > > > > big a succes.
> > > > > > I'm sure it's a small thing i've missed (i hope ;) ), so if anyone 
> > > > > > can
> > > > > > point me towards how what where?
>
> > > > > >   > > > > >            android:label="@string/app_name">
> > > > > >      
> > > > > >          
> > > > > >           > > > > > />
> > > > > >      
> > > > > >   
> > > > > >  
> > > > > >      
> > > > > >        
> > > > > >        
> > > > > >        
> > > > > >        
> > > > > >   
> > > > > > 
>
> > > > > > On Aug 31, 9:21 pm, EnnaN  wrote:
> > > > > > > There are a number of posts about getting your intent to actually
> > > > > > > register, but unfortunately i was not able to distill a sollution 
> > > > > > > from
> > > > > > > them. The simple concept of getting an image and doing something 
> > > > > > > with
> > > > > > > it seems to be too much at the moment :(
>
> > > > > > > I have the following in my manifest.xml:
>
> > > > > > > 
> > > > > > >          > > > > > >                   android:label="@string/app_name">
> > > > > > >             
> > > > > > >                  > > > > > > />
> > > > > > >                  > > > > > > android:name="android.intent.category.LAUNCHER" />
> > > > > > >             
> > > > > > >             
> > > > > > >                          > > > > > > android:name="android.intent.action.SEND"
> > > > > > />
> > > > > > >                          > > > > > android:name="android.intent.category.DEFAULT" />
> > > > > > >                         
> > > > > > >                         
> > > > > > >         
> > > > > > >     
>
> > > > > > > And this does what i thought it should do: when i press "share" 
> > > > > > > on a
> > > > > > > picture, i get my application as an option.
> > > > > > > Now, to act on this selecting, i thought to do this:
>
> > > > > > > registerReceiver(new BroadcastReceiver(){
> > > > > > >             @Override
> > > > > > >                 public void onReceive(Context context, Intent 
> > > > > > > intent) {
> > > > > > >                    //do some stuff
> > > > > > >                  }
> > > > > > >         }, new 
> > > > > > > IntentFilter("android.intent.action.SEND","image/*"));
>
> > > > > > > Now i've tried this with a seperate class, without the second 
> > > > > > > argument
> > > > > > > on the intentfilter, and with several variations of the intent
> > > > > > > action.SEND, but it doesn't seem to fire when i share my picture.
> > > > > > > Could anyone point me somewheres? Do i need an extra permiss

[android-developers] Re: what services are available at the API level?

2009-09-09 Thread Mark Murphy

Andy Droid wrote:
> That's a good point.  In addition to what I mentioned, I guess I'm
> really interested in ALL the API's, regardless of how they are
> implemented.  Are all API's documented in one place?

http://developer.android.com/reference/packages.html

But I suspect you've already been there, so I think I don't understand
what you're asking.

-- 
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: Is it possible to use the accelerometer in a background service?

2009-09-09 Thread Mike Collins


my service uses "getBaseContext()", seems to work just fine.  Don't
use it for
GPS but we do use it for many other things.

  mike


On Sep 9, 6:57 am, John Smith  wrote:
> It seems trivial to use GPS in a background service, but how can you
> do the same with the accelerometer?
>
> Everything I've tried seems to require a context, but a background
> service doesn't have a context?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: what services are available at the API level?

2009-09-09 Thread Andy Droid

That's a good point.  In addition to what I mentioned, I guess I'm
really interested in ALL the API's, regardless of how they are
implemented.  Are all API's documented in one place?

thanks


On Sep 4, 2:53 pm, Dianne Hackborn  wrote:
> The fact that it has "Service" in its name is kind-of irrelevant.  There are
> a bunch of APIs you can use, which may or may not talk with a system-side
> service for their implementation.  If you are just looking for interested
> related stuff to the classes you listed you an look at what
> Context.getSystemService() can return.
>
> On Fri, Sep 4, 2009 at 12:51 PM, Andy Droid  wrote:
>
> > I know about LocationManagerService, AlarmManagerService, and
> > BatteryService, from Android programming books, but is there a
> > published list of all available services?  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 to the systems Download Manager

2009-09-09 Thread Nathan Ekstrom
Will normal applications ever be given access to the systems Downloads
provider?
Nathan

--~--~-~--~~~---~--~~
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: onReceive not triggering for SEND / image

2009-09-09 Thread Beth

Here is the nudge you wanted...
Your intent filter needs to be set on an activity.  The code you
posted shows it as a Broadcast Receiver.
Change:

to

and move all your stuff from onRecieve to onCreate.  That should take
you forward.

Good luck!

On Sep 9, 10:25 am, EnnaN  wrote:
> and there we are. for future reference // other readers: i was looking
> for the following line:
>
> Intent i=getIntent();
>
> n.
>
> On Sep 9, 12:14 pm, EnnaN  wrote:
>
> > I know i'm bumping this, but i really think it's something simple i've
> > missed. Trying to avoid definitions i might be using incorrectly:
>
> > This is what i have:
> > An app that turns up in the "share" menu of the gallery.
> > Selecting my app starts it as if you would start it normally
>
> > This is what i don't have:
> > A way to react to the image i was looking at: i do not know where to
> > define code to do stuff with the picture.
>
> > Just a small nudge in the right direction is enough hopefully,
> > please? :D
>
> > Nanne.
>
> > On Sep 2, 1:51 pm, EnnaN  wrote:
>
> > > Thanks!
> > > THen i'm just confused about how to react to the intent -> at some
> > > point the images i'm sharing should be triggering some sort of event,
> > > so i can handle it. That's what i was trying to do with the receiver.
> > > Could you point me how to have a functions that reacts as an event-
> > > handler of the received 'SEND'?
>
> > > Nanne.
>
> > > On Sep 2, 8:52 am, Dianne Hackborn  wrote:
>
> > > > SEND is an activity action.  All you need to do is have it in your 
> > > > manifest
> > > > for an activity, as you have shown, and you know it is working because 
> > > > you
> > > > see it in the share menu, and when you select your item in the share 
> > > > menu
> > > > your activity will be launched with the intent.  That is all there is to
> > > > it.  There is no broadcast receiver involved at all, anywhere.
>
> > > > On Tue, Sep 1, 2009 at 11:42 PM, EnnaN  wrote:
>
> > > > > FOr some more information: I did try to add the intent to an
> > > > > "receiver" in the manifest XML on a tip i got, but this not only
> > > > > didn't work to start my receiver class, it also removed the "share"
> > > > > option from the image i was trying to do something with... So not so
> > > > > big a succes.
> > > > > I'm sure it's a small thing i've missed (i hope ;) ), so if anyone can
> > > > > point me towards how what where?
>
> > > > >   > > > >            android:label="@string/app_name">
> > > > >      
> > > > >          
> > > > >          
> > > > >      
> > > > >   
> > > > >  
> > > > >      
> > > > >        
> > > > >        
> > > > >        
> > > > >        
> > > > >   
> > > > > 
>
> > > > > On Aug 31, 9:21 pm, EnnaN  wrote:
> > > > > > There are a number of posts about getting your intent to actually
> > > > > > register, but unfortunately i was not able to distill a sollution 
> > > > > > from
> > > > > > them. The simple concept of getting an image and doing something 
> > > > > > with
> > > > > > it seems to be too much at the moment :(
>
> > > > > > I have the following in my manifest.xml:
>
> > > > > > 
> > > > > >          > > > > >                   android:label="@string/app_name">
> > > > > >             
> > > > > >                 
> > > > > >                  > > > > > android:name="android.intent.category.LAUNCHER" />
> > > > > >             
> > > > > >             
> > > > > >                          > > > > > android:name="android.intent.action.SEND"
> > > > > />
> > > > > >                          > > > > android:name="android.intent.category.DEFAULT" />
> > > > > >                         
> > > > > >                         
> > > > > >         
> > > > > >     
>
> > > > > > And this does what i thought it should do: when i press "share" on a
> > > > > > picture, i get my application as an option.
> > > > > > Now, to act on this selecting, i thought to do this:
>
> > > > > > registerReceiver(new BroadcastReceiver(){
> > > > > >             @Override
> > > > > >                 public void onReceive(Context context, Intent 
> > > > > > intent) {
> > > > > >                    //do some stuff
> > > > > >                  }
> > > > > >         }, new 
> > > > > > IntentFilter("android.intent.action.SEND","image/*"));
>
> > > > > > Now i've tried this with a seperate class, without the second 
> > > > > > argument
> > > > > > on the intentfilter, and with several variations of the intent
> > > > > > action.SEND, but it doesn't seem to fire when i share my picture.
> > > > > > Could anyone point me somewheres? Do i need an extra permission for
> > > > > > this intent maybe?
>
> > > > --
> > > > 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

[android-developers] Re: how to get events out of a service.

2009-09-09 Thread Mark Murphy

sdphil wrote:
> well I am making a media player like application -- so do i want it as
> a separate process using AIDL?

That depends on how many third party UIs you are seeking to have built
for your app. If the answer is "zero", then you probably do not want a
separate process.

> what are the pros/cons of using a separate process with AIDL vs. a
> local service?

Pros: If you are making a public API for third party UIs to use, this is
your only practical option.

Cons: Extra memory usage. Extra CPU usage when communicating between
them. Extra application complexity. Making Ms. Hackborn angry. ;-)

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



  1   2   3   >