[android-developers] Sharing a view among several activities

2009-11-04 Thread Gavin Bong
I want to create a little widget which displays a green bulb if there
is network connectivity and a red bulb if there is none.

Design:

a) register a BroadcastReceiver to listen for network connectivity
events
b) If the receiver receives a network down/up event, it will notify
the NetworkUptimeWidget to update itself.

Questions:

1) It looks like I will have to duplicate the code in every activity
to listen for updates (I am already using the include element to share
the XML declarations for NetworkUptimeWidget ). Is there any way to
avoid this ?
2) I am currently using the ContentObserver to notify the widget about
changes. Obviously that was meant for database providers. Is it wrong
to use it like a publish/subscribe method in the general sense ?

Thanks

Gavin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 2.0 SDK is here!

2009-11-04 Thread Nishant
Hello,

Why in-build javax.sound API of Java not introduced in Android 2.0?
Lots of problems occur in Android Sound API (AudioTrack as well as
MediaPlayer).

Regards,
Nishant Shah

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Using MediaPlayer best practices?

2009-11-04 Thread Alexey Krasnoriadtsev
Preparing a mediaPlayer is the most expensive operation.
calling stop() or pause() and then start() works best for me. You can
also peek at the MediaPlaybackService for inspiration.

Why do you think it will get into the bad state?


On Nov 3, 7:14 pm, Moto  wrote:
> What is the best way to use the MediaPlayer when needed multiple
> times?
>
> Reuse the instantiated MediaPlayer throughout the session?  Or
> constantly stop() release() and instantiate a new MediaPlayer() ?
>
> If I reuse I'm afraid the player could be in a bad state?
> What about performance wise? what's better? reuse or renew?
>
> Note: This is for using as a music player so one audio be present at
> one given time...
>
> Thank!
> -Moto!

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


[android-developers] Re: Getting outgoing number on HTC Hero (Sense) from HtcDialer

2009-11-04 Thread Junda
I have encountered the same problem and would to know if anyone has a
fix. But I observed on another HTC Hero with build  3.03.751.4, the
intent is broadcasted correctly.

On Sep 30, 7:51 pm, Arild  wrote:
> First, just let me apologize if this has been answered before, but I
> feel like I'm been all over the net to find the solution to this.
>
> What I'm trying to achieve:
> An "outgoing call" BroadcastReceiver which listens for
> "NEW_OUTGOING_CALL" intents. Since the application is only suppose
> handle certain predefined phone numbers the receiver need to check the
> outgoing phone number, and here lays the problem.
>
> The problem:
> When running on emulator or placing a call through the People/Contacts
> application on HTC Hero everything works just fine and the
> broadcastreceiver receives the "NEW_OUTGOING_CALL" intent. However,
> when running through the dialer on HTC Hero (which is htcDialer and
> not the default android dialer) the "NEW_OUTGOING_CALL" intent never
> seems to be fired and therefor the receiver never gets the outgoing
> phone number.
> I've tried listening to PHONE_STATE changes, but then I haven't found
> any way of retrieving the phone number.
>
> The question:
> Is there any way to get the outgoing phone number on HTC Hero (sense)
> when using htcDialer?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Getting outgoing number on HTC Hero (Sense) from HtcDialer

2009-11-04 Thread Arild
I've tried it with build 2.73.405.5 from the norwegian HTC site, so
that hopefully means it'll be fixed in future updates. However, I'm
not sure if the average user really upgrade the ROM on his/her phone.
But maybe the upgrade to Android 2.0 will be significant and talked
about enough for most users to upgrade their phones.

I can also tell you that I've tried to contact HTC (Europe) about the
matter, but was only told they didn't give any support for these kinds
of things but I could try writing their HQ in Taiwan through regular
mail, which I haven't bothered with. Here is the reply from them in
full:

"HTC Europe do not offer developer support other than through our
developer site on:

http://developer.htc.com

You can also attempt to request developer support in writing through
our global head office:



HTC Headquarters

23 Hsin Hua Rd.,

Taoyuan 330,

Taiwan,

Republic Of China
"

Arild

On Nov 4, 9:40 am, Junda  wrote:
> I have encountered the same problem and would to know if anyone has a
> fix. But I observed on another HTC Hero with build  3.03.751.4, the
> intent is broadcasted correctly.
>
> On Sep 30, 7:51 pm, Arild  wrote:
>
>
>
> > First, just let me apologize if this has been answered before, but I
> > feel like I'm been all over the net to find the solution to this.
>
> > What I'm trying to achieve:
> > An "outgoing call" BroadcastReceiver which listens for
> > "NEW_OUTGOING_CALL" intents. Since the application is only suppose
> > handle certain predefined phone numbers the receiver need to check the
> > outgoing phone number, and here lays the problem.
>
> > The problem:
> > When running on emulator or placing a call through the People/Contacts
> > application on HTC Hero everything works just fine and the
> > broadcastreceiver receives the "NEW_OUTGOING_CALL" intent. However,
> > when running through the dialer on HTC Hero (which is htcDialer and
> > not the default android dialer) the "NEW_OUTGOING_CALL" intent never
> > seems to be fired and therefor the receiver never gets the outgoing
> > phone number.
> > I've tried listening to PHONE_STATE changes, but then I haven't found
> > any way of retrieving the phone number.
>
> > The question:
> > Is there any way to get the outgoing phone number on HTC Hero (sense)
> > when using htcDialer?

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


[android-developers] Could the mediarecorder and the mediaplayer use the same surfaceview?

2009-11-04 Thread yjshi
 Hi,all!
  I use the mediarecorder to record the video.And I use the
surfaceview to preview the video while it is recording.And I want to
use the some surfaceview to playback this video that just has
recorded.But it does not work. Could anyone give me a suggestion?

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


Re: [android-developers] Trap in TabHost when AsyncTask delays setContentView at activity startup

2009-11-04 Thread Jeff Sharkey
Instead of delaying the setContentView() call, can you inflate that
layout and set its visibility to View.GONE temporarily until the
actual content arrives?

j


On Tue, Nov 3, 2009 at 8:52 PM, Lee Laborczfalvi  wrote:
> I've got a tab host activity started from a home screen shortcut.
> When my application starts it downloads information from a server
> using an AsyncTask. In the onPostExecute method of the AsyncTask I
> call setContentView to display the TabHost.
>
> When I start the homescreen shortcut by tapping on the shortcut using
> my finger everything works as expected, I download the information
> from the server and display the TabHost with the information in the
> tabs.
>
> However starting the application by navigating to the shortcut with
> the mouse wheel and then clicking on the shortcut with the mouse wheel
> leads to a trap in the framework code as soon as my application
> starts.  The stack trace is below:
>
> 11-04 15:45:40.113: ERROR/AndroidRuntime(3360): Uncaught handler:
> thread main exiting due to uncaught exception
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360): java.lang.NullPointerException
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.widget.TabHost.onTouchModeChanged(TabHost.java:179)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.view.ViewTreeObserver.dispatchOnTouchModeChanged(ViewTreeObserver.java:591)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.view.ViewRoot.ensureTouchModeLocally(ViewRoot.java:1877)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.view.ViewRoot.performTraversals(ViewRoot.java:715)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.os.Looper.loop(Looper.java:123)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> android.app.ActivityThread.main(ActivityThread.java:4203)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
> dalvik.system.NativeStart.main(Native Method)
>
> Looking at the code for the TabHost class I see the following code at
> the point where the trap occurs
>
>    public void onTouchModeChanged(boolean isInTouchMode) {
>        if (!isInTouchMode) {
>            // leaving touch mode.. if nothing has focus, let's give it to
>            // the indicator of the current tab
> TRAP ON THIS LINE >             if (!mCurrentView.hasFocus() ||
> mCurrentView.isFocused()) {
>
> mTabWidget.getChildTabViewAt(mCurrentTab).requestFocus();
>            }
>        }
>    }
>
> This looks like a simple fix since mCurrentView is null at the time
> that this method is called - can this issue be addressed? Does anyone
> know of any workarounds?
>
> 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
>



-- 
Jeff Sharkey
jshar...@android.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


Re: [android-developers] Re: Regarding the database schema of Android native database

2009-11-04 Thread Jeff Sharkey
If you're looking to interact with the built-in Contacts or MediaStore
databases, you should interact through the ContentProvider abstraction
layer.  The underlying database schema can change, but these public
APIs will continue working across releases:

http://d.android.com/guide/topics/providers/content-providers.html

http://d.android.com/reference/android/provider/ContactsContract.html
http://d.android.com/reference/android/provider/MediaStore.html

j


On Tue, Nov 3, 2009 at 6:42 PM, PJ  wrote:
> If there isn't any documentation, you could always get the schema
> directly from the source.
>
> Read the section "Examining sqlite3 Databases from a Remote Shell"
> from the Dev Guide:
> http://developer.android.com/guide/developing/tools/adb.html#sqlite
>
> This describes how to view databases for an application, but this
> technique also works for examining the system's databases, too.
> You just need to know where they are, e.g. try: # sqlite3 /data/system/
> accounts.db
>
> Hope this helps!
> -- PJ
>
>
> On Nov 1, 9:30 pm, richard  wrote:
>> Hello all,
>>
>>      I want to build my own cloned databases of all or some of the
>> Android native databases like Contacts, Calllogs, Mediastore,
>> Settings, etc.  I want to know wheher it is possible and How I can
>> know the database schemas of these databases?  Is there any
>> documentation on this?
>>
>>      Thank you very much.
>>
>> regards
>> Xiaofeng
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Jeff Sharkey
jshar...@android.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


Re: [android-developers] Trap in TabHost when AsyncTask delays setContentView at activity startup

2009-11-04 Thread Lee Laborczfalvi
I'll give this a go and let you know how it works.

Thanks for the tip.
Lee

On Wed, Nov 4, 2009 at 8:27 PM, Jeff Sharkey  wrote:
> Instead of delaying the setContentView() call, can you inflate that
> layout and set its visibility to View.GONE temporarily until the
> actual content arrives?
>
> j
>
>
> On Tue, Nov 3, 2009 at 8:52 PM, Lee Laborczfalvi  wrote:
>> I've got a tab host activity started from a home screen shortcut.
>> When my application starts it downloads information from a server
>> using an AsyncTask. In the onPostExecute method of the AsyncTask I
>> call setContentView to display the TabHost.
>>
>> When I start the homescreen shortcut by tapping on the shortcut using
>> my finger everything works as expected, I download the information
>> from the server and display the TabHost with the information in the
>> tabs.
>>
>> However starting the application by navigating to the shortcut with
>> the mouse wheel and then clicking on the shortcut with the mouse wheel
>> leads to a trap in the framework code as soon as my application
>> starts.  The stack trace is below:
>>
>> 11-04 15:45:40.113: ERROR/AndroidRuntime(3360): Uncaught handler:
>> thread main exiting due to uncaught exception
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360): 
>> java.lang.NullPointerException
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.widget.TabHost.onTouchModeChanged(TabHost.java:179)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.view.ViewTreeObserver.dispatchOnTouchModeChanged(ViewTreeObserver.java:591)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.view.ViewRoot.ensureTouchModeLocally(ViewRoot.java:1877)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.view.ViewRoot.performTraversals(ViewRoot.java:715)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.os.Handler.dispatchMessage(Handler.java:99)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.os.Looper.loop(Looper.java:123)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> android.app.ActivityThread.main(ActivityThread.java:4203)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> java.lang.reflect.Method.invokeNative(Native Method)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> java.lang.reflect.Method.invoke(Method.java:521)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
>> 11-04 15:45:40.213: ERROR/AndroidRuntime(3360):     at
>> dalvik.system.NativeStart.main(Native Method)
>>
>> Looking at the code for the TabHost class I see the following code at
>> the point where the trap occurs
>>
>>    public void onTouchModeChanged(boolean isInTouchMode) {
>>        if (!isInTouchMode) {
>>            // leaving touch mode.. if nothing has focus, let's give it to
>>            // the indicator of the current tab
>> TRAP ON THIS LINE >             if (!mCurrentView.hasFocus() ||
>> mCurrentView.isFocused()) {
>>
>> mTabWidget.getChildTabViewAt(mCurrentTab).requestFocus();
>>            }
>>        }
>>    }
>>
>> This looks like a simple fix since mCurrentView is null at the time
>> that this method is called - can this issue be addressed? Does anyone
>> know of any workarounds?
>>
>> 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
>>
>
>
>
> --
> Jeff Sharkey
> jshar...@android.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

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


[android-developers] calendar

2009-11-04 Thread jera g.
where is the calendar application in android 2.0? i can't seem to find
it in the emulator.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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.com e-mail addresses

2009-11-04 Thread Fred Grott(Android Expert, http://mobilebytes.wordpress.com)
No, for Google engineers working on Android OS only

On Nov 4, 1:01 am, PJ  wrote:
> If someone has an android.com e-mail address, what does that mean?
> Can serious app developers get one?

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


[android-developers] Re: Error after installing 1.6 on DEV PHONE

2009-11-04 Thread Eric Wong (hdmp4.com)
Is there a way to fix this without doing a wipe?
(I just upgraded to 1.6 from 1.5)

Thanks
Eric

On Oct 8, 6:11 pm, jayan  wrote:
>  there is an Option at Settings = "Sdcard & Phone Storage" next search
> "Factory Data Reset".
>
> and it will restart the phone. but you will be invited to setting up
> your gmail account. and will loose your WPA key for wifi.
>
> after your must reinstall your apps. but it wont delete your images.
>
> On Oct 8, 6:45 am, nickthecook  wrote:
>
> > And here is the logcat output for trying to start the Market... :)
>
> > I/ActivityManager(   74): Starting activity: Intent
> > { act=android.intent.action.MAIN cat=
> > [android.intent.category.LAUNCHER] flg=0x1020
> > cmp=com.android.vending/.AssetBrowserActivity }
> > I/ActivityManager(   74): Start proc com.android.vending for activity
> > com.android.vending/.AssetBrowserActivity: pid=308 uid=10019 gids=
> > {3003}
> > I/ActivityThread(  308): Publishing provider
> > com.android.vending.SuggestionsProvider:
> > com.android.vending.SuggestionsProvider
> > I/ActivityManager(   74): Starting activity: Intent
> > { cmp=com.android.vending/.TosActivity }
> > D/dalvikvm(  308): GC freed 3652 objects / 280040 bytes in 208ms
> > I/ActivityManager(   74): Displayed activity
> > com.android.vending/.TosActivity: 1855 ms (total 3256 ms)
> > D/vending (  308):
> > com.android.vending.BaseActivity.completeGetAuthToken(): auth result
> > is RESULT_CANCELED
> > D/vending (  308): com.android.vending.BaseActivity.onAuthTokenComplete
> > (): null auth token.
>
> > On Oct 7, 9:43 pm, nickthecook  wrote:
>
> > > Here is the logcat for the Google Partner Setup crash:
>
> > > D/Sync    (   74): Received boot completed action
> > > I/ActivityManager(   74): Stopping service:
> > > com.android.providers.subscribedfeeds/.SubscribedFeedsIntentService
> > > I/ActivityManager(   74): Stopping service:
> > > com.android.mms/.transaction.SmsReceiverService
> > > D/MediaScanner(  185):    total time: 180ms
> > > D/MediaScannerService(  185): done scanning volume internal
> > > I/ActivityManager(   74): Stopping service:
> > > com.android.providers.media/.MediaScannerService
> > > D/HomeLoaders(  122):   > cleared application list
> > > D/GooglePartnerSetup(  225): GooglePartnerSetup.onReceive
> > > E/ActivityThread(  225): Failed to find provider info for
> > > com.google.settings
> > > E/ActivityThread(  225): Failed to find provider info for
> > > com.google.settings
> > > D/AndroidRuntime(  225): Shutting down VM
> > > W/dalvikvm(  225): threadid=3: thread exiting with uncaught exception
> > > (group=0x4001da28)
> > > E/AndroidRuntime(  225): Uncaught handler: thread main exiting due to
> > > uncaught exception
> > > I/ActivityManager(   74): Start proc com.android.calendar for
> > > broadcast com.android.providers.calendar/.CalendarReceiver: pid=233
> > > uid=10011 gids={3003}
> > > E/AndroidRuntime(  225): java.lang.RuntimeException: Unable to start
> > > receiver com.google.android.partnersetup.GooglePartnerSetup:
> > > java.lang.IllegalArgumentException: Unknown URL 
> > > content://com.google.settings/partner
> > > E/AndroidRuntime(  225):        at 
> > > android.app.ActivityThread.handleReceiver
> > > (ActivityThread.java:2550)
> > > E/AndroidRuntime(  225):        at android.app.ActivityThread.access$3000
> > > (ActivityThread.java:116)
> > > E/AndroidRuntime(  225):        at 
> > > android.app.ActivityThread$H.handleMessage
> > > (ActivityThread.java:1843)
> > > E/AndroidRuntime(  225):        at android.os.Handler.dispatchMessage
> > > (Handler.java:99)
> > > E/AndroidRuntime(  225):        at android.os.Looper.loop(Looper.java:123)
> > > E/AndroidRuntime(  225):        at android.app.ActivityThread.main
> > > (ActivityThread.java:4203)
> > > E/AndroidRuntime(  225):        at java.lang.reflect.Method.invokeNative
> > > (Native Method)
> > > E/AndroidRuntime(  225):        at java.lang.reflect.Method.invoke
> > > (Method.java:521)
> > > E/AndroidRuntime(  225):        at com.android.internal.os.ZygoteInit
> > > $MethodAndArgsCaller.run(ZygoteInit.java:791)
> > > E/AndroidRuntime(  225):        at com.android.internal.os.ZygoteInit.main
> > > (ZygoteInit.java:549)
> > > E/AndroidRuntime(  225):        at dalvik.system.NativeStart.main(Native
> > > Method)
> > > E/AndroidRuntime(  225): Caused by:
> > > java.lang.IllegalArgumentException: Unknown URL 
> > > content://com.google.settings/partner
> > > E/AndroidRuntime(  225):        at android.content.ContentResolver.insert
> > > (ContentResolver.java:476)
> > > E/AndroidRuntime(  225):        at
> > > com.google.android.providers.GoogleSettings$NameValueTable.putString
> > > (GoogleSettings.java:75)
> > > E/AndroidRuntime(  225):        at
> > > com.google.android.providers.GoogleSettings$Partner.putString
> > > (GoogleSettings.java:189)
> > > E/AndroidRuntime(  225):        at
> > > com.google.android.partnersetup.GooglePartnerSetup.setClientId
> > > (GooglePartnerSetup.java:109)
> 

[android-developers] Re: Android 2.0 SDK is here!

2009-11-04 Thread poohtbear
Hi.
I'm trying to produce source code for the SDK (gather it from the git
repository and put it under ./sources directory under platform-2.0).
i can't however find a tag in the git repository of 2.0 ? can anyone
tell me why ? how do i check out the code of 2.0 ?

Eyal.

On Oct 27, 6:45 pm, Xavier Ducrohet  wrote:
> Hello everyone!
>
> We've just announced the Android 2.0 
> SDKhttp://android-developers.blogspot.com/2009/10/announcing-android-20-...
>
> If you already have the 1.6 SDK, note that you can simply use the SDK
> Manager to add Android 2.0 to your SDK. Make sure you also get the new
> SDK Tools (revision 3), as the SDK Manager in revision 2 (the one that
> shipped with 1.6) doesn't enforce dependencies between platforms and
> Tools (fixed in rev 3)
>
> For more information about using the SDK Manager, 
> see:http://developer.android.com/sdk/adding-components.html
>
> Have fun!
> Xav
> --
> Xavier Ducrohet
> Android SDK Tech Lead
> Google Inc.

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


Re: [android-developers] Re: Problem running a compiled/packaged-with-v1.6 application on v1.5

2009-11-04 Thread Armond Avanes
Lance, Thanks for your reply.

Finally I could track down the problem. "" was the root of 
the issue! For whatever reason, that exception occurs when I build against v1.6 
and run it under v1.5 or when I build it against v1.5 and run it under v1.6... 
The problem vanishes when I remove my PreferenceCategory's from 
"preferences.xml".

Can you reproduce this with your code?

As for the cause, when I tracked it even further, I found out that when a 
 is inflated using the default layout, it's using  
"preference_category.xml" layout from platform (you can find it under 
"/platforms/android-1.x/data/res/layout"). You'll find the 
following block inside the file (both for v1.5 and v1.6):

http://schemas.android.com/apk/res/android";
style="?android:attr/listSeparatorTextViewStyle"
android:id="@+android:id/title"
/>

And obviously it includes neither "layout_height" not "layout_width" attribute! 
As a solution (maybe temporary!), I copied this file to my project's "layout/" 
directory and added the above missing parameters to it. And in my 
"preferences.xml" I assigned android:layout="@layout/preference_category" 
attribute to all of the  tags. The problem resolved!!!

But I'm still in wonder with such missing parameter, why it works flawlessly 
when I build and run the project under the same Android version??

Best Regards,
Armond




- Original Message 
> From: Lance Nanek 
> To: Android Developers 
> Sent: Wed, November 4, 2009 3:44:20 AM
> Subject: [android-developers] Re: Problem running a 
> compiled/packaged-with-v1.6  application on v1.5
> 
> Hmm, I have an app that similarly uses a PreferenceActivity and build
> target 1.6, but it runs fine on the 1.5 emulator. I wonder what we are
> doing different.
> 
> Is your activity just the basic form like this?
> public class Preferences extends PreferenceActivity {
> @Override
> protected void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> addPreferencesFromResource(R.xml.preferences);
> }
> }
> 
> Are you calling Preference#setLayoutResource in any way? Seems like
> that could change the XML file being used. I think I found the default
> one in the Android source, but don't see the missing attribute in it.
> 
> On Nov 3, 5:03 pm, "Armond Avanes" wrote:
> > Hi Guys,
> >
> > I have an application which is based Android 1.5 but for enabling different
> > screen types support I have to compile and package it with v1.6. When I
> > install and run the resulted APK on my 1.5 emulator, everything works fine
> > except that "Preferences" activity crashes every time I launch it!
> >
> > When I revert back my API dependency to 1.5 and remove a few 1.6 specific
> > config blocks from AndroidManifest.xml and compile/package it with 1.5,
> > everything works just fine!!
> >
> > Below is the exception I get when it crashes. I will highly appreciate any
> > help on this:
> >
> > D/AndroidRuntime(  985): Shutting down VM
> > W/dalvikvm(  985): threadid=3: thread exiting with uncaught exception
> > (group=0x4000fe70)
> > E/AndroidRuntime(  985): Uncaught handler: thread main exiting due to
> > uncaught exception
> > E/AndroidRuntime(  985): java.lang.RuntimeException: Binary XML file line
> > #18: You must supply a layout_width attribute.
> > E/AndroidRuntime(  985):at
> > android.content.res.TypedArray.getLayoutDimension(TypedArray.java:438)
> > E/AndroidRuntime(  985):at
> > android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3319)
> > E/AndroidRuntime(  985):at
> > android.view.ViewGroup$LayoutParams.(ViewGroup.java:3274)
> > E/AndroidRuntime(  985):at
> > android.widget.AbsListView$LayoutParams.(AbsListView.java:3242)
> > E/AndroidRuntime(  985):at
> > android.widget.AbsListView.generateLayoutParams(AbsListView.java:3123)
> > E/AndroidRuntime(  985):at
> > android.widget.AbsListView.generateLayoutParams(AbsListView.java:69)
> > E/AndroidRuntime(  985):at
> > android.view.LayoutInflater.inflate(LayoutInflater.java:395)
> > E/AndroidRuntime(  985):at
> > android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> > E/AndroidRuntime(  985):at
> > android.preference.Preference.onCreateView(Preference.java:412)
> > E/AndroidRuntime(  985):at
> > android.preference.Preference.getView(Preference.java:389)
> > E/AndroidRuntime(  985):at
> > android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.jav
> > a:187)
> > E/AndroidRuntime(  985):at
> > android.widget.AbsListView.obtainView(AbsListView.java:1269)
> > E/AndroidRuntime(  985):at
> > android.widget.ListView.makeAndAddView(ListView.java:1623)
> > E/AndroidRuntime(  985):at
> > android.widget.ListView.fillDown(ListView.java:607)
> > E/AndroidRuntime(  985):at
> > android.widget.ListView.fillFromTop(ListView.java:664)
> > E/AndroidRuntime(  985):at
> > android.widget.ListView.layoutChildren(Li

Re: [android-developers] Re: text animation

2009-11-04 Thread Anh Khoa Nguyen Pham
Hi pskink,
Can your way make text displayed in rotate mode?

On Wed, Nov 4, 2009 at 2:39 PM, skink  wrote:

> On Tue, Nov 3, 2009 at 2:49 PM, npak...@gmail.com 
> > >> wrote:
> > >> > > Hi all,
> >
> > >> > > Now i want to write an application to make a certain text to run
> > >> > > slowly from right side screen to left side screen and rotate to
> > >> > > repeat.
> > >> > > How can i do that? Please help me !
>
> hi,
>
> just extend View and do custom drawing using Handler that runs forever
> incrementing some xOffset that you will use in your onDraw method.
>
> pskink
> > >> > > Thanks all,
> >
> > >> > > NPAK
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 2.0 SDK is here!

2009-11-04 Thread Nishant
Hi,

You can download source code from:

http://android.git.kernel.org/?p=platform/dalvik.git;a=tree;hb=HEAD

Thanks & Regards,
Nishant Shah

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


Re: [android-developers] Re: [Android-developers] Display APIs in Android?

2009-11-04 Thread Latha Shivanna
> You can directly draw onto surface bound with canvas passed in in your
> draw handler. You don't have to always first draw into bitmap then
> copy from bitmap to surface.

can you please give me some sample code for the same? It would be
really helpful. Or any references where i can have a look at for this
draw handler example?

-Latha

On Wed, Nov 4, 2009 at 8:50 AM, Westermann Fu  wrote:
> You can directly draw onto surface bound with canvas passed in in your
> draw handler. You don't have to always first draw into bitmap then
> copy from bitmap to surface.
>
> In fact, no matter what strategy you use you have not really drawn
> onto screen framebuffer directly, the last action is composing done by
> surfaceflinger service which sit in native layer but it only export
> limited method you can access. I think directly accessing /dev/
> graphics/fb0 is not recommand by android platform.
>
> On Nov 4, 12:35 am, Latha Shivanna  wrote:
>> I need some 2D apis. can anybody suggest something?
>>
>> Are there any ways to display a buffer on screen in native layer? I am
>> aware of using some ioctl calls on /dev/graphics/fb0.(But it needs
>> root access)
>>
>> Please do advise.
>>
>> -Latha
>>
>> On Tue, Nov 3, 2009 at 7:12 PM, sham shamcs  wrote:
>> > you can use opengl also
>>
>> > On Tue, Nov 3, 2009 at 5:54 PM, Latha Shivanna  wrote:
>>
>> >> Hii All
>>
>> >> Can anybody please tell me how can we display a buffer on screen?
>>
>> >> Currently I create a bitmap using Bitmap's CreateBitmap() and render
>> >> it on screen using canvas' drawBitmap().
>>
>> >> Is there any other way of doing this in Java layer?
>>
>> >> Please do share your thoughts.
>>
>> >> thanks in advance
>> >> Latha
>>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Android Developers" group.
>> >> To post to this group, send email to android-developers@googlegroups.com
>> >> To unsubscribe from this group, send email to
>> >> android-developers+unsubscr...@googlegroups.com
>> >> For more options, visit this group at
>> >>http://groups.google.com/group/android-developers?hl=en
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-developers@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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


Re: [android-developers] ALT key for a virtual keyboard

2009-11-04 Thread Dianne Hackborn
No, an IME doesn't provide any modifiers, it inserts the final UTF-16
characters into the text.

On Tue, Nov 3, 2009 at 9:37 PM, droidin.net  wrote:

> Basically I want to capture Alt-key combination to provide some
> customized alternative text input. For example Alt-f would put FOO
> into the text field. However there doesn't seem to be ALT key on the
> virtual keyboard in ether portrait or landscape. Is it possible to
> fake Alt key on the virtual keyboard somehow?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

Re: [android-developers] Re: Problem running a compiled/packaged-with-v1.6 application on v1.5

2009-11-04 Thread Armond Avanes
Lance,

Digging further showed that it was the problem with my "theme customization".

The default "preference_category.xml" is referring to 
"listSeparatorTextViewStyle" as its style. But I've customized the 
"listSeparatorTextViewStyle" and for whatever reason it does not correctly 
inherit the "layout_width" and "layout_hight" attributes from Android default 
theme.

In my "themes.xml":
@style/Widget.TextView.ListSeparator

In my "styles.xml":

@drawable/blue_header


Solution: I just copied all the attributes from Android default 
"Widget.TextView.ListSeparator" and the problem got fixed! No other changes, 
including the ones I just mentioned in my previous reply, are needed:


@drawable/blue_header

fill_parent
25dip
bold
?android:attr/textColorSecondary
14sp
center_vertical
5sp


And I guess this is the final solution for those whom want to customize their 
"ListView"s (and the related separator). But I still can't understand why this 
occurs when the build/packaging platform is not the same as the deployment one. 
Hope someone from Android engineering team answers me.

Best Regards,
Armond



- Original Message 
> From: Armond Avanes 
> To: android-developers@googlegroups.com
> Sent: Wed, November 4, 2009 2:00:50 PM
> Subject: Re: [android-developers] Re: Problem running a 
> compiled/packaged-with-v1.6   application on v1.5
> 
> Lance, Thanks for your reply.
> 
> Finally I could track down the problem. "" was the root of 
> the issue! For whatever reason, that exception occurs when I build against 
> v1.6 
> and run it under v1.5 or when I build it against v1.5 and run it under 
> v1.6... 
> The problem vanishes when I remove my PreferenceCategory's from 
> "preferences.xml".
> 
> Can you reproduce this with your code?
> 
> As for the cause, when I tracked it even further, I found out that when a 
> is inflated using the default layout, it's using  
> "preference_category.xml" layout from platform (you can find it under 
> "/platforms/android-1.x/data/res/layout"). You'll find the 
> following block inside the file (both for v1.5 and v1.6):
> 
> 
> style="?android:attr/listSeparatorTextViewStyle"
> android:id="@+android:id/title"
> />
> 
> And obviously it includes neither "layout_height" not "layout_width" 
> attribute! 
> As a solution (maybe temporary!), I copied this file to my project's 
> "layout/" 
> directory and added the above missing parameters to it. And in my 
> "preferences.xml" I assigned android:layout="@layout/preference_category" 
> attribute to all of the tags. The problem resolved!!!
> 
> But I'm still in wonder with such missing parameter, why it works flawlessly 
> when I build and run the project under the same Android version??
> 
> Best Regards,
> Armond
> 
> 
> 
> 
> - Original Message 
> > From: Lance Nanek 
> > To: Android Developers 
> > Sent: Wed, November 4, 2009 3:44:20 AM
> > Subject: [android-developers] Re: Problem running a 
> compiled/packaged-with-v1.6  application on v1.5
> > 
> > Hmm, I have an app that similarly uses a PreferenceActivity and build
> > target 1.6, but it runs fine on the 1.5 emulator. I wonder what we are
> > doing different.
> > 
> > Is your activity just the basic form like this?
> > public class Preferences extends PreferenceActivity {
> > @Override
> > protected void onCreate(Bundle savedInstanceState) {
> > super.onCreate(savedInstanceState);
> > addPreferencesFromResource(R.xml.preferences);
> > }
> > }
> > 
> > Are you calling Preference#setLayoutResource in any way? Seems like
> > that could change the XML file being used. I think I found the default
> > one in the Android source, but don't see the missing attribute in it.
> > 
> > On Nov 3, 5:03 pm, "Armond Avanes" wrote:
> > > Hi Guys,
> > >
> > > I have an application which is based Android 1.5 but for enabling 
> > > different
> > > screen types support I have to compile and package it with v1.6. When I
> > > install and run the resulted APK on my 1.5 emulator, everything works fine
> > > except that "Preferences" activity crashes every time I launch it!
> > >
> > > When I revert back my API dependency to 1.5 and remove a few 1.6 specific
> > > config blocks from AndroidManifest.xml and compile/package it with 1.5,
> > > everything works just fine!!
> > >
> > > Below is the exception I get when it crashes. I will highly appreciate any
> > > help on this:
> > >
> > > D/AndroidRuntime(  985): Shutting down VM
> > > W/dalvikvm(  985): threadid=3: thread exiting with uncaught exception
> > > (gro

[android-developers] Re: Trouble Rendering Bitmaps Correctly in OpenGL

2009-11-04 Thread abowman
If you can solve my problem, I'll send you a Google Wave invite.  :)


On Nov 2, 6:39 am, abowman  wrote:
> I'm basically using the same method of loading bitmaps in OpenGL that
> the SpriteMethodTest example uses and have been unable to get rid of
> an annoying outline that appears around all of my images.
>
> For example, If I were to load an image of a  white circle on a white
> background, I would expect to see nothing.  Instead, I would see my
> circle because its edge would be gray.  In SpriteMethodTest, I
> replaced the background image with white and was able to see that the
> edges of the android images flying around also don't seem to be
> rendered correctly.
>
> Does anyone know how to load images in OpenGL without having a thin
> outline appear around the images?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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] Display APIs in Android?

2009-11-04 Thread niko20
Hi,

OnDraw gets a Canvas object passed to it. You basically draw directly
to this object (Use Canvas's methods to do the drawing). However, you
won't be double buffering then so you may see some flicker.

-niko

On Nov 4, 5:33 am, Latha Shivanna  wrote:
> > You can directly draw onto surface bound with canvas passed in in your
> > draw handler. You don't have to always first draw into bitmap then
> > copy from bitmap to surface.
>
> can you please give me some sample code for the same? It would be
> really helpful. Or any references where i can have a look at for this
> draw handler example?
>
> -Latha
>
> On Wed, Nov 4, 2009 at 8:50 AM, Westermann Fu  wrote:
> > You can directly draw onto surface bound with canvas passed in in your
> > draw handler. You don't have to always first draw into bitmap then
> > copy from bitmap to surface.
>
> > In fact, no matter what strategy you use you have not really drawn
> > onto screen framebuffer directly, the last action is composing done by
> > surfaceflinger service which sit in native layer but it only export
> > limited method you can access. I think directly accessing /dev/
> > graphics/fb0 is not recommand by android platform.
>
> > On Nov 4, 12:35 am, Latha Shivanna  wrote:
> >> I need some 2D apis. can anybody suggest something?
>
> >> Are there any ways to display a buffer on screen in native layer? I am
> >> aware of using some ioctl calls on /dev/graphics/fb0.(But it needs
> >> root access)
>
> >> Please do advise.
>
> >> -Latha
>
> >> On Tue, Nov 3, 2009 at 7:12 PM, sham shamcs  wrote:
> >> > you can use opengl also
>
> >> > On Tue, Nov 3, 2009 at 5:54 PM, Latha Shivanna  
> >> > wrote:
>
> >> >> Hii All
>
> >> >> Can anybody please tell me how can we display a buffer on screen?
>
> >> >> Currently I create a bitmap using Bitmap's CreateBitmap() and render
> >> >> it on screen using canvas' drawBitmap().
>
> >> >> Is there any other way of doing this in Java layer?
>
> >> >> Please do share your thoughts.
>
> >> >> thanks in advance
> >> >> Latha
>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups "Android Developers" group.
> >> >> To post to this group, send email to android-developers@googlegroups.com
> >> >> To unsubscribe from this group, send email to
> >> >> android-developers+unsubscr...@googlegroups.com
> >> >> For more options, visit this group at
> >> >>http://groups.google.com/group/android-developers?hl=en
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups "Android Developers" group.
> >> > To post to this group, send email to android-developers@googlegroups.com
> >> > To unsubscribe from this group, send email to
> >> > android-developers+unsubscr...@googlegroups.com
> >> > For more options, visit this group at
> >> >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Stable contact identity & CONTENT_LOOKUP_URI

2009-11-04 Thread jarkman
Dmitri - thanks - that's perfect.

So, we have two choices -

(1) For each incoming contact URI, loop over our table of stored
lookup keys, looking each one up with
ContactsContract.Contacts.lookupContact(resolver, lookupUri) and
comparing with the incoming contact.

I think that will be reliable, and makes the best use of your cunning
lookup mechanisms, but could be a performance problem.


(2) Move our custom data into the generic data store in the contacts
database ( as hinted at here:
http://groups.google.com/group/android-developers/browse_thread/thread/690cd4e531205b0c/364e21a52b00491c?lnk=gst&q=contacts#364e21a52b00491c
)

That should be reliable, but I am not sure what will happen to the
generic data rows over contact aggregation and disaggregation.
Presumably we may find a contact who has two instances of our custom
data (after aggregation) or none (after disaggregation, if our custom
data stayed with the other half of the results).


(3) In our own table, keep all the raw contact IDs for each aggregated
contact we are interested in. That lets us deal with the aftermath of
aggregation and disaggregation explicitly, and it lets us search
quickly by comparing IDs, but it means we need to do something
complicated to clean up our data after a disaggregation has has
happened.

Do you think that covers it ?


Richard

On Nov 3, 7:17 pm, Dmitri Plotnikov  wrote:
> Hi Richard,
>
> Lookup key is unique at any point in time.  It's not unique over time.
>
> The anatomy of a lookup key is basically this.  If an aggregate contact has
> three raw contacts with server-side IDs "A", "B" and "C", the lookup key
> will effectively be  accountA/A.accountB/B.accountC/C
>
> We don't attempt to find a contact with that exact lookup key.  We actually
> parse it, find all those three raw contacts and infer the id of the new
> contact ID, which will be the one containing the most of the original raw
> contacts. In other words, even though the result is a bit unpredictable, the
> user shouldn't be surprised by what they see.  The original contact had A, B
> and C - now I am looking at something that has either A or B or C or a
> couple of those or maybe A,B,C and D.
>
> You are right that you should not use lookup keys to compare contact
> identities to each other.  You can use the
> ContactsContract.Contacts.lookupContact(resolver, lookupUri) method, which
> will give you the current contact ID for your contact.  Be careful though -
> between the moment you get it and the moment you use it the contact may
> change.  Any kind of background sync could cause this change to happen.  I
> would try to design the software in such a way that either doesn't need to
> do this type of resolution or uses something even more robust than lookup
> keys, e.g. raw contact IDs.
>
> I hope this helps,
> - Dmitri
>
> On Tue, Nov 3, 2009 at 6:40 AM, jarkman  wrote:
> > Oh - one more question:
>
> > Am I right in thinking that the lookup URI is not itself a unique,
> > stable identifier ? That is, the lookup URI for one contact may be
> > different at different times.
>
> > Right now, we store some contact row IDs in a table, along with per-
> > contact settings of our own. We use a WHERE clause on the contact ID
> > to pull out the settings for a particular contact.
>
> > If we store lookup URIs in the table, and want to find some current
> > contact in that table, we cannot do it by comparing lookup URIs
> > directly, because the lookup URI for the target contact may have
> > changed since we wrote the table. If we want to compare two lookup
> > URIs to see if they refer to the same person, we need to look them
> > both up in the contacts table and see if they have the same record ID
> > right now. Is that right ?
>
> > Thanks,
>
> > Richard
>
> > On Nov 2, 5:32 pm, Dmitri Plotnikov  wrote:
> > > Hi Richard,
>
> > > You are exactly right.  If you want a robust persistent reference to a
> > > contact, you now need to use the lookup URI.  Android itself uses lookup
> > > URIs for shortcuts, Quick Contact etc.  The main reason contact ID is
> > > volatile is that Android 2.0 has contact aggregation, both automatic and
> > > manual.  Let's say your app stored a long ID of a contact.  Then the user
> > > goes and manually joins the contact with some other contact. Now we have
> > one
> > > contact where we used to have two - the stored long contact ID points
> > > nowhere.  However, the lookup key is more resilient.  It's a string
> > > concatenating identities of raw contacts.  Using that string, we can
> > still
> > > track down a contact as it is joined with others or separated from them.
>
> > > There are two options available to you: you can store just the lookup
> > key,
> > > which is a string id of a contact, or you can use both the lookup and the
> > > long id of a contact.  The latter will give you better performance, but
> > > functionally the long id is not required.  I would take this approach: if
> > > you need to bulk-process conta

Re: [android-developers] What is the Sprint Hero AppWidget problem?

2009-11-04 Thread Justin Giles
It might be related to this problem (which HTC has said isn't their
problem):

http://groups.google.com/group/android-developers/browse_thread/thread/3b7aced444a47425

Justin

On Wed, Nov 4, 2009 at 12:20 AM, btm...@gmail.com  wrote:

> Hello all,
>
> I wrote a widget that has been working fine for most folks. However, I
> started getting bug reports about how the widget would be blank on
> reboot (not receive an update?), and it seemed that the Sprint Hero
> continually came up. I thought I was crazy but I'm finding that other
> people are having the same problems:
>
> Searching Google for "sprint hero appwidget problems" yields:
>
> "Added warning about the problem on the Sprint Hero device: On the
> Sprint Hero (HTC ROM v1.29.xxx) the AppWidget API is broken in such a
> way that it won't ..."
>
> More specific blog post that mentions it but doesn't explain the
> problem:
>
> http://koxx3.wordpress.com/2009/10/22/htc-hero-sprint-bug/
>
> "I found the reason : HTC changed the Android widget management at
> startup !
> I hope they will fix it in a new ROM release, but I’d like to find a
> solution to bypass this problem.
> EDIT 28/10/2009 : problem solve for ‘Pure calendar’ with new option."
>
> I e-mailed the author in hopes of getting an answer, but I haven't
> received any response. Does anybody with a Sprint Hero know what the
> problem is?
>
> Thank you,
> -Brian
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Subclass of ArrayAdapter not working

2009-11-04 Thread jax
I have subclassed ArrayAdapter to set the color of text to RED if the
string does not contain 100%, this has been added to a ListView.  The
problem is that some of the rows show as red when they contain 100%.
Why would this happen?


/*
 * Subclass of ArrayAdapter to change the color of the
 * text to red if it is not 100%
 *
 */
public class ScoringAdapter extends ArrayAdapter {

private ArrayList items;

public ScoringAdapter(Context context, int textViewResourceId,
ArrayList items) {
super(context, textViewResourceId, items);
this.items = items;
}

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
try {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate
(android.R.layout.simple_list_item_1, null);
}

String item = items.get(position);
TextView tv = (TextView) v.findViewById
(android.R.id.text1);
tv.setText(item);

if(!item.contains("100%")) {
tv.setTextColor(Color.RED);
}

return v;
}
catch(Exception e) {
e.printStackTrace();
}

return null;
}
}

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


[android-developers] Max size of android application

2009-11-04 Thread Archana
What is the maximum size that android application can hold?
I have one database(.sqlite extension) file with 147 mb,
Is it possible to include that file in my app.?I tried to put it in my
asset folder but while running it showing message like  "No space left
on device".

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


Re: [android-developers] Max size of android application

2009-11-04 Thread Mark Murphy
Archana wrote:
> I have one database(.sqlite extension) file with 147 mb,
> Is it possible to include that file in my app.?

Not really. Some devices do not have 147MB of app storage available.

I would keep your APK size down to a few MB if you are trying to
distribute it via the Android Market, AndAppStore, etc. That may mean
downloading the database yourself from the Web and storing it on the SD
card.

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

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

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


Re: [android-developers] Subclass of ArrayAdapter not working

2009-11-04 Thread Mark Murphy
jax wrote:
> I have subclassed ArrayAdapter to set the color of text to RED if the
> string does not contain 100%, this has been added to a ListView.  The
> problem is that some of the rows show as red when they contain 100%.
> Why would this happen?

You are recycling rows but not resetting their color. Hence, over time,
most if not all of your rows will be red.

> if(!item.contains("100%")) {
>   tv.setTextColor(Color.RED);
> }

In the above code snippet, also handle the "else" branch and reset the
color to its normal state.

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

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

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


Re: [android-developers] Dynamically grow listview

2009-11-04 Thread Martin Obreshkov
This approach is good but in first place i was looking for something else.
In the article the method of growing the listview is simply to take care
when the last visible element is reached and the listview grows with new
elements (just like in android store when you scroll down apps) but what i
was looking for is to implement something more like the native Android Music
player. When you upload 2000 song on your sd card and start the Music Player
the list with songs grow automatically and you see how the scroll is getting
smaller. It's seems the player is querying the database all the time.
Any idea how this functionality is implemented in the native android Music
Player.

On Mon, Nov 2, 2009 at 8:15 PM, Martin Obreshkov  wrote:

> Thanks, this is just what i was looking for
>
>
> On Mon, Nov 2, 2009 at 8:07 PM, Carmen Delessio 
> wrote:
>
>> AndroidGuys has an article for that:
>> http://www.androidguys.com/2009/10/21/tutorial-autogrowing-listview/
>> --
>> Carmen
>> http://www.twitter.com/CarmenDelessio
>> http://www.talkingandroid.com
>> http://www.facebook.com/BFFPhoto
>> http://www.twitter.com/DroidDrop
>>
>>
>> On Mon, Nov 2, 2009 at 1:50 PM, manigault  wrote:
>>
>>> Hi,
>>> I am trying to make ListView which should display data from db. But
>>> the db is filled slowly so want the entries in the ListView to grow
>>> dynamically according to the elements in db.
>>> For example on a desktop music player when you import a folder to the
>>> music library the list with songs is filling in real time with the
>>> newly added songs.
>>> So how can i get this working on android.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>
>>
>>
>>
>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> When I raise my flashing sword, and my hand takes hold on judgment, I will
> take vengeance upon mine enemies, and I will repay those who haze me. Oh,
> Lord, raise me to Thy right hand and count me among Thy saints.
>



-- 
When I raise my flashing sword, and my hand takes hold on judgment, I will
take vengeance upon mine enemies, and I will repay those who haze me. Oh,
Lord, raise me to Thy right hand and count me among Thy saints.

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

[android-developers] Scroll Event in Android

2009-11-04 Thread Maxood
I am developing an app in which i am using random numbers to retrieve
data from my database and drawable from an array. Here is my code:


public class Facts extends Activity {
/** Called when the activity is first created. */

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

int factNo, imgNo;
int[] bgNo={2130837505, 2130837516, 2130837525, 2130837526,
2130837527,
2130837528, 2130837529, 2130837530, 2130837531, 
2130837506,
2130837507, 2130837508, 2130837509, 2130837510, 
2130837511,
2130837512, 2130837513, 2130837514, 2130837515, 
2130837517,
2130837518, 2130837519, 2130837520, 2130837521, 
2130837522,
2130837523, 2130837524};


Random rand = new Random();



//for(int i=1;i<=636;i++)
//{

factNo = rand.nextInt(636);
imgNo = rand.nextInt(27);
//}

TextView tv = new TextView(this);

ScrollView sv = new ScrollView(this);



DBAdapter db = new DBAdapter(this);
/*
db.open();

long id;
for(int i = 1;i<=636;i++)
{
id = db.insertFact("Sex Fact " + i);

}

*/

db.open();



Cursor c = db.getFact(factNo);

if (c.moveToFirst())
{
   // db.displayFact(c);
  //  Toast.makeText(this, c.getString(1),
Toast.LENGTH_LONG).show();

tv.setPadding(50, 200, 50, 200);

tv.setBackgroundResource(bgNo[imgNo]);
//tv.setBackgroundResource(imgNo);
tv.setText(c.getString(1));
tv.scrollBy(0, 400);
setContentView(tv);

}
else
{
Toast.makeText(this, "No title found",
Toast.LENGTH_LONG).show();
}
db.close();



}

My requirement is to do the same thing on a scroll event instead of on
create event. How is that possible?

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


Re: [android-developers] Dynamically grow listview

2009-11-04 Thread Mark Murphy
Martin Obreshkov wrote:
> This approach is good but in first place i was looking for something
> else. In the article the method of growing the listview is simply to
> take care when the last visible element is reached and the listview
> grows with new elements (just like in android store when you scroll down
> apps) but what i was looking for is to implement something more like the
> native Android Music player. When you upload 2000 song on your sd card
> and start the Music Player the list with songs grow automatically and
> you see how the scroll is getting smaller. It's seems the player is
> querying the database all the time.
> Any idea how this functionality is implemented in the native android
> Music Player.

Perhaps using an AsyncTask and updating the contents of an ArrayAdapter
via publishProgress().

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

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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Thanks it worked, I changed it to

if(!item.contains("100%")) {
tv.setTextColor(Color.RED);
}
else {
tv.setTextColor(Color.BLACK);
}

but I still don't understand why...

Do you know any sites that explain about recycling views?




On Nov 4, 8:45 pm, Mark Murphy  wrote:
> jax wrote:
> > I have subclassed ArrayAdapter to set the color of text to RED if the
> > string does not contain 100%, this has been added to a ListView.  The
> > problem is that some of the rows show as red when they contain 100%.
> > Why would this happen?
>
> You are recycling rows but not resetting their color. Hence, over time,
> most if not all of your rows will be red.
>
> >                 if(!item.contains("100%")) {
> >                    tv.setTextColor(Color.RED);
> >                 }
>
> In the above code snippet, also handle the "else" branch and reset the
> color to its normal state.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Trouble setting contact photos with ContactsContract

2009-11-04 Thread jarkman
Well, I found a simpler way, which seems to work. You need to know
that the photo lives in the extension data for a contact, so you are
just adding a row of extension data with the right contact ID.

Here's adding a photo:
  ByteArrayOutputStream bytes = new ByteArrayOutputStream();
  bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes);

  ContentValues values = new ContentValues();

  values.put(ContactsContract.Data.RAW_CONTACT_ID, personId);
  values.put(ContactsContract.CommonDataKinds.Photo.PHOTO,
bytes.toByteArray());
  values.put(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE );

  context.getContentResolver().update
(ContactsContract.Data.CONTENT_URI, values,
ContactsContract.Data.RAW_CONTACT_ID + " = " + personId, null);


And here is removing one:
  context.getContentResolver().delete
(ContactsContract.Data.CONTENT_URI,
ContactsContract.Data.RAW_CONTACT_ID + " = " + String.valueOf
(personId) +
" AND " + ContactsContract.Data.MIMETYPE + " = " + "\"" +
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE+ "\"",
null);


Richard

On Nov 3, 11:47 am, jarkman  wrote:
> I'm happily retrieving contact photos with the new ContactsContract
> APIs and cursor.getBlob, but I'm having great trouble working out how
> to set a contact photo.
>
> I believe I have the right URI (at least, it works for retrieving the
> photo), but it just won't work for updating or adding one.
>
> Here's my best bet:
>
> ByteArrayOutputStream bytes = new ByteArrayOutputStream();
> bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes);
>
> Uri uri = Uri.withAppendedPath( ContactsContract.Contacts.CONTENT_URI,
> friendId );
> uri = Uri.withAppendedPath( uri,
> ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
>
> // eg: content://com.android.contacts/contacts/6/photo
>
> ContentValues values = new ContentValues();
>
> values.put(ContactsContract.CommonDataKinds.Photo.PHOTO,
> bytes.toByteArray());
> values.put(ContactsContract.CommonDataKinds.Photo.MIMETYPE,
> ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE );
>
> context.getContentResolver().insert(uri, values);
>
> And here's my exception:
>
> java.lang.UnsupportedOperationException: Unknown uri:
> content://com.android.contacts/contacts/6/photo
>      at com.android.providers.contacts.LegacyApiSupport.update
> (LegacyApiSupport.java:914)
>      at
> com.android.providers.contacts.ContactsProvider2.updateInTransaction
> (ContactsProvider2.java:2924)
>      at com.android.providers.contacts.SQLiteContentProvider.update
> (SQLiteContentProvider.java:139)
>      at com.android.providers.contacts.ContactsProvider2.update
> (ContactsProvider2.java:1923)
>      at android.content.ContentProvider$Transport.update
> (ContentProvider.java:180)
>      at android.content.ContentProviderNative.onTransact
> (ContentProviderNative.java:195)
>      at android.os.Binder.execTransact(Binder.java:287)
>      at dalvik.system.NativeStart.run(Native Method)
>
> Any thoughts ?
>
> Thanks,
>
> Richard

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Verify musical instrument app idea: microphone, simultaneous record and play, elevation, multi-touch

2009-11-04 Thread Ulrich Althöfer
Yes, those applications are the hype, I think!
But what's about guitar-playing?
You need 4 fingers simultaneously and more (for to hit the string)? I
read about, that the multi-touch-option is limited to 3 simultaneously
fingers touched.
I am glad to see such applications!

Greetings
Ulrich


On 4 Nov., 05:15, PJ  wrote:
> I have a great idea for an app and wanted to get everyone's input on 4
> different technical aspects of it.
>
> Some of you might be familiar with the iPhone musical app where you
> can "play" it like a flute/ocarina.  You blow into the mic and use
> multi-touch to press a combination of holes to play different sounds.
>
> I'm thinking about writing a *similar* app for Android, except it's a
> *trumpet* instead of a flute.  My idea is:
> * The screen shows three circles in a line, which represent the three
> trumpet valves.
> * Touching a circle represents holding down a valve.
> * Blowing into the mic represents blowing into the trumpet.
> * Note: On a "real" trumpet, the note pitch depends not only on the
> valve combination, but also on the lip vibrations.  (Otherwise there
> would only be 7-8 possible notes.)
> * I'm thinking that the angle (elevation) of the phone could represent
> different pitches.  So, if you elevate the phone up, you'll play a
> higher note, for example.
>
> The 4 technical aspects that I'd like to verify are:
>
> 1. What is the most sensible way to detect blowing into the
> microphone?  My current plan is to do AudioRecord.read() and manually
> examine the audio buffer data to check for sufficiently high amplitude
> (volume).  I think this will be pretty easy, but just wanted to check
> whether there's another better way to do this.
>
> 2. Is it possible to record and play at the same time?  I need to
> record blowing into the mic and playing sound at the same time.
>
> 3. For checking elevation angle, I assume I should use SensorManager.
> I assume that I want to use getInclination(), but I think I might also
> need getRotationMatrix() or getOrientation().  Seems pretty easy, but
> does anyone know of any examples I could look at?
>
> 4. For detecting which valves are pressed down, I assume that it's
> feasible to use the multi-touch feature.  However, I have a G1 phone.
> Is it possible to get multi-touch to work with the G1 phone somehow?
> (This question probably deserves its own thread!)
>
> I'm not going to ask about how to program multi-touch because there's
> a good discussion of the technical features 
> at:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> Anyway, your input is highly welcome, as well as any other suggestions
> you might have for this app.  (By the way, I might do other
> instruments too, besides, trumpet, but I figure that if I can get
> trumpet to work, I can get any other instrument to work.)

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


Re: [android-developers] Re: Subclass of ArrayAdapter not working

2009-11-04 Thread Mark Murphy
jax wrote:
> Thanks it worked, I changed it to
> 
> if(!item.contains("100%")) {
>   tv.setTextColor(Color.RED);
> }
> else {
>   tv.setTextColor(Color.BLACK);
> }
> 
> but I still don't understand why...
> 
> Do you know any sites that explain about recycling views?

http://commonsware.com/Android/excerpt.pdf

That is an excerpt from one of my books that talks about the process.

Remember that the view you are recycling once held a row. Android does
not somehow magically reset those rows to their original look. Hence, if
you changed the color before, you may have to change it back.

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

Android Consulting/App Development: http://commonsware.com/consulting

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


[android-developers] Guru Meditation@ AudioTrack(51): *** SERIOUS WARNING *** obtainBuffer() timed out

2009-11-04 Thread Mike
Hello,

I am using MediaPlayer to play background music and SoundPool to play
sound effects. All Audio data is stored in .ogg file format.
Sometimes it happens that the MediaPlayer playback is interrupted for
a fraction of a second if SoundPool.play() is called. Whenever this
happens, the following two warnings are printed to logcat:

11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is
the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710
11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING ***
obtainBuffer() timed out but didn't need to be locked. We recovered,
but this shouldn't happen (user=000cc520, server=000cb710)

Do you have any ideas what could cause the warning messages and/or how
to avoid them? I.e. how to prevent SoundPool.play() from interrupting
MediaPlayer playback?

An other warning that's sometimes appearing is:
11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs
There seems to be no connection to the above messages, but do you have
any ideas what causes this message and/or how to avoid it?


Here's some more detailed background information, maybe they are
useful:
My OpenGL powered game is split into three threads: One for rendering,
one to take care about the game logic and the main thread to process
user input.
All Audio data is accessed through a central AudioManager class, which
is only used in the game logic thread. (So this does not seem like a
threading issue. Needless to say that synchronizing all methods has
not solved the problem).
The game runs smoothly at ~60 frames per second. According to DDMS the
game causes ~33% system load (~10% in kernel space and ~23% in user
space) on a G1. Even the idle task gets ~24% CPU time assigned while
the game is running and input happens through the touch screen! (So it
does not look like a performance problem)
The MediaPlayer playback interruption always happens if SoundPool.play
() is called in response of a touch screen input. Although touch
screen input and SoundPool.play() happen in different threads. I've
tried suspending the UI thread for various different delays between 8
and 32 msec after a MotionEvent has been processed, but again, without
success...

I've spent days optimizing the game and finding the cause of the
interrupted MediaPlayer playback, but without success. Now I've run
out of ideas. So any advice that could help solving the problem is
highly appreciated!

Thanks in advance,
Mike.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Max size of android application

2009-11-04 Thread Archana
Actually i am working on G1 device.So  it might be difficult rit?


On Nov 4, 6:43 pm, Mark Murphy  wrote:
> Archana wrote:
> > I have one database(.sqlite extension) file with 147 mb,
> > Is it possible to include that file in my app.?
>
> Not really. Some devices do not have 147MB of app storage available.
>
> I would keep your APK size down to a few MB if you are trying to
> distribute it via the Android Market, AndAppStore, etc. That may mean
> downloading the database yourself from the Web and storing it on the SD
> card.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

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


Re: [android-developers] Re: Max size of android application

2009-11-04 Thread Mark Murphy
Archana wrote:
> Actually i am working on G1 device.So  it might be difficult rit?

The G1 has 70MB for all apps. It would be difficult to have 147MB in
your app.

Again, download the database yourself and store it on the SD card.

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.2 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: Max size of android application

2009-11-04 Thread Archana
Can u send me some links mentioning android memory size and internal
storage.
I searched but i am not getting any documentation related to this.

On Nov 4, 6:43 pm, Mark Murphy  wrote:
> Archana wrote:
> > I have one database(.sqlite extension) file with 147 mb,
> > Is it possible to include that file in my app.?
>
> Not really. Some devices do not have 147MB of app storage available.
>
> I would keep your APK size down to a few MB if you are trying to
> distribute it via the Android Market, AndAppStore, etc. That may mean
> downloading the database yourself from the Web and storing it on the SD
> card.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

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


[android-developers] Cannot start volume '/sdcard' (volume is not bound) error using vold

2009-11-04 Thread sreedhar b
Hi All,

Iam seeing the SDcard mount issue with the donut release 1.6_r1.

This uses vold.

Please see the below log portion for details:


# I/vold(  620): Android Volume Daemon version 2.0
I/vold(  620): New MMC card 'MMC08G' (serial 520946106) added @
/devices/EMMC/mmc_host/mmc0/mmc0:0001
I/vold(  620): Disk (blkdev 179:0), 15638528 secs (7636 MB) 4 partitions
I/vold(  620): New blkdev 179.0 on media MMC08G, media path
/devices/EMMC/mmc_host/mmc0/mmc0:0001, Dpp 4
I/vold(  620): Partition (blkdev 179:1), 16384 secs (8 MB) type 0x83
I/vold(  620): New blkdev 179.1 on media MMC08G, media path
/devices/EMMC/mmc_host/mmc0/mmc0:0001, Dpp 3
I/vold(  620): Partition (blkdev 179:2), 524288 secs (256 MB) type 0x83
I/vold(  620): New blkdev 179.2 on media MMC08G, media path
/devices/EMMC/mmc_host/mmc0/mmc0:0001, Dpp 2
I/vold(  620): Partition (blkdev 179:3), 2277376 secs (1112 MB) type
0x83
I/vold(  620): New blkdev 179.3 on media MMC08G, media path
/devices/EMMC/mmc_host/mmc0/mmc0:0001, Dpp 1
I/vold(  620): New MMC card 'SU02G
I/vold(  620): ' (serial 821168021) added @
/devices/MMC/mmc_host/mmc1/mmc1:bf0a
I/vold(  620): Disk (blkdev 179:8), 3862528 secs (1886 MB) 4 partitions
I/vold(  620): New blkdev 179.8 on media SU02G
I/vold(  620): , media path /devices/MMC/mmc_host/mmc1/mmc1:bf0a, Dpp 1
W/vold(  620): Skipping partition 8
I/vold(  620): Partition (blkdev 179:9), 3858489 secs (1884 MB) type 0x0
I/vold(  620): New blkdev 179.9 on media SU02G
I/vold(  620): , media path /devices/MMC/mmc_host/mmc1/mmc1:bf0a, Dpp 0
E/vold(  620): Unable to open '/sys/class/switch' (No such file or
directory)
D/vold(  620): Bootstrapping complete

---


D/vold(  620): Accepted connection from framework
D/vold(  620): dispatch_cmd(send_ums_status):
D/dalvikvm(  636): GC freed 4588 objects / 209768 bytes in 105ms
D/MountListener(  636): handleEvent volume_nomedia:/sdcard
D/vold(  620): dispatch_cmd(mount_volume:/sdcard):
E/vold(  620): Cannot start volume '/sdcard' (volume is not bound)


The log gives  some error like this
E/vold(  620): Unable to open '/sys/class/switch' (No such file or
directory)
E/vold(  620): Cannot start volume '/sdcard' (volume is not bound)

Please let me know if someone already has seen this issue and how to
overcome the same.


If i manually run the following command,
$mount -t vfat /dev/block/mmcblk1p1 /sdcard

then i am able to see inside the /sdcard my SDCard contents.

Regards,
Sreedhar

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

Re: [android-developers] Re: Max size of android application

2009-11-04 Thread Mark Murphy
Archana wrote:
> Can u send me some links mentioning android memory size and internal
> storage.
> I searched but i am not getting any documentation related to this.

Search Google for:

G1 70MB

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.2 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: Guru Meditation@ AudioTrack(51): *** SERIOUS WARNING *** obtainBuffer() timed out

2009-11-04 Thread Ulrich Althöfer
Yes, I can confirm the error message:
"AudioFlinger write blocked for 53 msecs"
Have a look at the entry:
"SoundPool: playing/stopping-delaytime sometimes greater 300 ms"
http://groups.google.com/group/android-developers/browse_thread/threa...

I have got no answers at all to those problems here.

Greetings
Ulrich

On 4 Nov., 14:32, Mike  wrote:
> Hello,
>
> I am using MediaPlayer to play background music and SoundPool to play
> sound effects. All Audio data is stored in .ogg file format.
> Sometimes it happens that the MediaPlayer playback is interrupted for
> a fraction of a second if SoundPool.play() is called. Whenever this
> happens, the following two warnings are printed to logcat:
>
> 11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is
> the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710
> 11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING ***
> obtainBuffer() timed out but didn't need to be locked. We recovered,
> but this shouldn't happen (user=000cc520, server=000cb710)
>
> Do you have any ideas what could cause the warning messages and/or how
> to avoid them? I.e. how to prevent SoundPool.play() from interrupting
> MediaPlayer playback?
>
> An other warning that's sometimes appearing is:
> 11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs
> There seems to be no connection to the above messages, but do you have
> any ideas what causes this message and/or how to avoid it?
>
> Here's some more detailed background information, maybe they are
> useful:
> My OpenGL powered game is split into three threads: One for rendering,
> one to take care about the game logic and the main thread to process
> user input.
> All Audio data is accessed through a central AudioManager class, which
> is only used in the game logic thread. (So this does not seem like a
> threading issue. Needless to say that synchronizing all methods has
> not solved the problem).
> The game runs smoothly at ~60 frames per second. According to DDMS the
> game causes ~33% system load (~10% in kernel space and ~23% in user
> space) on a G1. Even the idle task gets ~24% CPU time assigned while
> the game is running and input happens through the touch screen! (So it
> does not look like a performance problem)
> The MediaPlayer playback interruption always happens if SoundPool.play
> () is called in response of a touch screen input. Although touch
> screen input and SoundPool.play() happen in different threads. I've
> tried suspending the UI thread for various different delays between 8
> and 32 msec after a MotionEvent has been processed, but again, without
> success...
>
> I've spent days optimizing the game and finding the cause of the
> interrupted MediaPlayer playback, but without success. Now I've run
> out of ideas. So any advice that could help solving the problem is
> highly appreciated!
>
> Thanks in advance,
> Mike.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Advice Needed on Application Approach

2009-11-04 Thread Tabibito
So does that mean there's no way to tell the difference between the
phone starting up and calling onCallStateChanged, and the caller
hanging up and calling onCallStateChanged?

On Nov 3, 2:13 pm, Mark Murphy  wrote:
> Dianne Hackborn wrote:
> > I'm not sure it is published in the SDK.  There was a round of
> > simplication of the telephony APIs right before release to have what was
> > published in a state that could be maintained, and I think that may have
> > involved hiding the way these updates are sent.
>
> Dagnabbit. I had hopes for getting rid of another reason for people to
> try creating everlasting services.
>
> Thanks!
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android 1.6 Programming Books:http://commonsware.com/books

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


Re: [android-developers] Re: Advice Needed on Application Approach

2009-11-04 Thread Mark Murphy
Tabibito wrote:
> So does that mean there's no way to tell the difference between the
> phone starting up and calling onCallStateChanged, and the caller
> hanging up and calling onCallStateChanged?

I do not know what "the phone starting up" means, sorry.

There are three call states tracked by a PhoneStateListener: idle,
ringing, and "off hook" (i.e., call in progress).

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

Android Training in Germany, 18-22 January 2010: http://bignerdranch.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: Guru Meditation@ AudioTrack(51): *** SERIOUS WARNING *** obtainBuffer() timed out

2009-11-04 Thread Ulrich Althöfer
Excuse me, the correct link of my above message is:
http://groups.google.com/group/android-developers/browse_thread/thread/4e7a0eabd2727864/8d8cbb7421af147b?lnk=gst&q=SoundPool%3A+playing%2Fstopping-delaytime+sometimes+greater+300+ms

Greetings
Ulrich

On 4 Nov., 14:44, Ulrich Althöfer  wrote:
> Yes, I can confirm the error message:
> "AudioFlinger write blocked for 53 msecs"
> Have a look at the entry:
> "SoundPool: playing/stopping-delaytime sometimes greater 300 
> ms"http://groups.google.com/group/android-developers/browse_thread/threa...
>
> I have got no answers at all to those problems here.
>
> Greetings
> Ulrich
>
> On 4 Nov., 14:32, Mike  wrote:
>
> > Hello,
>
> > I am using MediaPlayer to play background music and SoundPool to play
> > sound effects. All Audio data is stored in .ogg file format.
> > Sometimes it happens that the MediaPlayer playback is interrupted for
> > a fraction of a second if SoundPool.play() is called. Whenever this
> > happens, the following two warnings are printed to logcat:
>
> > 11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is
> > the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710
> > 11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING ***
> > obtainBuffer() timed out but didn't need to be locked. We recovered,
> > but this shouldn't happen (user=000cc520, server=000cb710)
>
> > Do you have any ideas what could cause the warning messages and/or how
> > to avoid them? I.e. how to prevent SoundPool.play() from interrupting
> > MediaPlayer playback?
>
> > An other warning that's sometimes appearing is:
> > 11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs
> > There seems to be no connection to the above messages, but do you have
> > any ideas what causes this message and/or how to avoid it?
>
> > Here's some more detailed background information, maybe they are
> > useful:
> > My OpenGL powered game is split into three threads: One for rendering,
> > one to take care about the game logic and the main thread to process
> > user input.
> > All Audio data is accessed through a central AudioManager class, which
> > is only used in the game logic thread. (So this does not seem like a
> > threading issue. Needless to say that synchronizing all methods has
> > not solved the problem).
> > The game runs smoothly at ~60 frames per second. According to DDMS the
> > game causes ~33% system load (~10% in kernel space and ~23% in user
> > space) on a G1. Even the idle task gets ~24% CPU time assigned while
> > the game is running and input happens through the touch screen! (So it
> > does not look like a performance problem)
> > The MediaPlayer playback interruption always happens if SoundPool.play
> > () is called in response of a touch screen input. Although touch
> > screen input and SoundPool.play() happen in different threads. I've
> > tried suspending the UI thread for various different delays between 8
> > and 32 msec after a MotionEvent has been processed, but again, without
> > success...
>
> > I've spent days optimizing the game and finding the cause of the
> > interrupted MediaPlayer playback, but without success. Now I've run
> > out of ideas. So any advice that could help solving the problem is
> > highly appreciated!
>
> > Thanks in advance,
> > Mike.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 know if it the emulator or device

2009-11-04 Thread Diego Torres Milano
As Dianne mentioned assuming that because there's no wifi you are
running on the emulator is a bit risky. There could be real phones
with no wifi and emulator emulating wifi.
Stick to any of the other methods.

On Nov 4, 6:19 am, Zhihong GUO  wrote:
> It can not work. There is no exception throws and the wifiManager returned
> can be used as wifiManager.isEnabled()
>
> 2009/11/4 Dianne Hackborn 
>
> > On Tue, Nov 3, 2009 at 11:10 AM, Roman ( T-Mobile USA) <
> > roman.baumgaert...@t-mobile.com> wrote:
>
> >> Furthermore the API call
>
> >>  (WifiManager)mContext.getSystemService(mWifiService);
>
> >> gives you an exception on the Emulator which is an indication that
> >> Wifi radio is not supported.
>
> > That's only because it doesn't happen to currently be implemented in the
> > emulator.  This could very well change in the future.
>
> > --
> > 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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: The mysterious disappearing progress bar...

2009-11-04 Thread dadical
Anyone have a clue?  I'm guessing it has something to do with changes
in Donut related to buffering or optimizing display of Z-Order of
views in relative layout, but maybe it's something simpler...

I'm stacking:

LinearLayout
   RelativeLayout
  VideoView  (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
  ProgressBar (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
  TextView (WRAP_CONTENT, WRAP_CONTENT, BELOW(my progress bar))

I was counting on relative layout displaying the progress bar and the
text view on top of the video view because they were added to the
layout after the video view.  That worked in 1.5, but stopped since
1.6.


On Nov 2, 11:36 pm, dadical  wrote:
> The following code used to render an indeterminate progress bar with a
> message below, all on top of a video view.  Once the video was ready,
> the message and the progress bar would be made invisible.  Ever since
> cupcake, the progress bar doesn't show at all.  Anyone have any clues?
>
> dk
>
>         private void setupView() {
>                 LinearLayout lLinLayout = new LinearLayout(this);
>             lLinLayout.setId(1);
>             lLinLayout.setOrientation(LinearLayout.VERTICAL);
>             lLinLayout.setGravity(Gravity.CENTER);
>             lLinLayout.setBackgroundColor(Color.BLACK);
>
>             LayoutParams lLinLayoutParms = new LayoutParams
> (ViewGroup.LayoutParams.FILL_PARENT,
> ViewGroup.LayoutParams.FILL_PARENT);
>             lLinLayout.setLayoutParams(lLinLayoutParms);
>
>             this.setContentView(lLinLayout);
>
>             RelativeLayout lRelLayout = new RelativeLayout(this);
>             lRelLayout.setId(2);
>             lRelLayout.setGravity(Gravity.CENTER);
>             lRelLayout.setBackgroundColor(Color.BLACK);
>             android.widget.RelativeLayout.LayoutParams lRelLayoutParms = new
> android.widget.RelativeLayout.LayoutParams
> (ViewGroup.LayoutParams.FILL_PARENT,
> ViewGroup.LayoutParams.FILL_PARENT);
>             lRelLayout.setLayoutParams(lRelLayoutParms);
>             lLinLayout.addView(lRelLayout);
>
>             mVideoView = new VideoView(this);
>             mVideoView.setId(3);
>             android.widget.RelativeLayout.LayoutParams lVidViewLayoutParams =
> new android.widget.RelativeLayout.LayoutParams
> (ViewGroup.LayoutParams.WRAP_CONTENT,
> ViewGroup.LayoutParams.WRAP_CONTENT);
>             lVidViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
>             mVideoView.setLayoutParams(lVidViewLayoutParams);
>             lRelLayout.addView(mVideoView);
>
>             mProgressBar = new ProgressBar(this);
>             mProgressBar.setId(4);
>             android.widget.RelativeLayout.LayoutParams
> lProgressBarLayoutParms = new
> android.widget.RelativeLayout.LayoutParams
> (ViewGroup.LayoutParams.WRAP_CONTENT,
> ViewGroup.LayoutParams.WRAP_CONTENT);
>             lProgressBarLayoutParms.addRule(RelativeLayout.CENTER_IN_PARENT);
>             mProgressBar.setLayoutParams(lProgressBarLayoutParms);
>             lRelLayout.addView(mProgressBar);
>
>             mProgressMessage = new TextView(this);
>             mProgressMessage.setId(5);
>             android.widget.RelativeLayout.LayoutParams
> lProgressMsgLayoutParms = new
> android.widget.RelativeLayout.LayoutParams
> (ViewGroup.LayoutParams.WRAP_CONTENT,
> ViewGroup.LayoutParams.WRAP_CONTENT);
>             lProgressMsgLayoutParms.addRule
> (RelativeLayout.CENTER_HORIZONTAL);
>             lProgressMsgLayoutParms.addRule(RelativeLayout.BELOW, 4);
>             mProgressMessage.setLayoutParams(lProgressMsgLayoutParms);
>             mProgressMessage.setTextColor(Color.LTGRAY);
>             mProgressMessage.setTextSize(TypedValue.COMPLEX_UNIT_PT, 8);
>             mProgressMessage.setText("...");
>             lRelLayout.addView(mProgressMessage);
>         }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: The mysterious disappearing progress bar...

2009-11-04 Thread Mika
I had a similar problem and it was just because the default
progressbar had changed in Donut and it was all white. So I had a
white progressbar in a white background. Not sure if that's your
problem though.

-Mika

On Nov 4, 5:02 pm, dadical  wrote:
> Anyone have a clue?  I'm guessing it has something to do with changes
> in Donut related to buffering or optimizing display of Z-Order of
> views in relative layout, but maybe it's something simpler...
>
> I'm stacking:
>
> LinearLayout
>    RelativeLayout
>       VideoView  (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
>       ProgressBar (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
>       TextView (WRAP_CONTENT, WRAP_CONTENT, BELOW(my progress bar))
>
> I was counting on relative layout displaying the progress bar and the
> text view on top of the video view because they were added to the
> layout after the video view.  That worked in 1.5, but stopped since
> 1.6.
>
> On Nov 2, 11:36 pm, dadical  wrote:
>
>
>
> > The following code used to render an indeterminate progress bar with a
> > message below, all on top of a video view.  Once the video was ready,
> > the message and the progress bar would be made invisible.  Ever since
> > cupcake, the progress bar doesn't show at all.  Anyone have any clues?
>
> > dk
>
> >         private void setupView() {
> >                 LinearLayout lLinLayout = new LinearLayout(this);
> >             lLinLayout.setId(1);
> >             lLinLayout.setOrientation(LinearLayout.VERTICAL);
> >             lLinLayout.setGravity(Gravity.CENTER);
> >             lLinLayout.setBackgroundColor(Color.BLACK);
>
> >             LayoutParams lLinLayoutParms = new LayoutParams
> > (ViewGroup.LayoutParams.FILL_PARENT,
> > ViewGroup.LayoutParams.FILL_PARENT);
> >             lLinLayout.setLayoutParams(lLinLayoutParms);
>
> >             this.setContentView(lLinLayout);
>
> >             RelativeLayout lRelLayout = new RelativeLayout(this);
> >             lRelLayout.setId(2);
> >             lRelLayout.setGravity(Gravity.CENTER);
> >             lRelLayout.setBackgroundColor(Color.BLACK);
> >             android.widget.RelativeLayout.LayoutParams lRelLayoutParms = new
> > android.widget.RelativeLayout.LayoutParams
> > (ViewGroup.LayoutParams.FILL_PARENT,
> > ViewGroup.LayoutParams.FILL_PARENT);
> >             lRelLayout.setLayoutParams(lRelLayoutParms);
> >             lLinLayout.addView(lRelLayout);
>
> >             mVideoView = new VideoView(this);
> >             mVideoView.setId(3);
> >             android.widget.RelativeLayout.LayoutParams lVidViewLayoutParams 
> > =
> > new android.widget.RelativeLayout.LayoutParams
> > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > ViewGroup.LayoutParams.WRAP_CONTENT);
> >             lVidViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
> >             mVideoView.setLayoutParams(lVidViewLayoutParams);
> >             lRelLayout.addView(mVideoView);
>
> >             mProgressBar = new ProgressBar(this);
> >             mProgressBar.setId(4);
> >             android.widget.RelativeLayout.LayoutParams
> > lProgressBarLayoutParms = new
> > android.widget.RelativeLayout.LayoutParams
> > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > ViewGroup.LayoutParams.WRAP_CONTENT);
> >             
> > lProgressBarLayoutParms.addRule(RelativeLayout.CENTER_IN_PARENT);
> >             mProgressBar.setLayoutParams(lProgressBarLayoutParms);
> >             lRelLayout.addView(mProgressBar);
>
> >             mProgressMessage = new TextView(this);
> >             mProgressMessage.setId(5);
> >             android.widget.RelativeLayout.LayoutParams
> > lProgressMsgLayoutParms = new
> > android.widget.RelativeLayout.LayoutParams
> > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > ViewGroup.LayoutParams.WRAP_CONTENT);
> >             lProgressMsgLayoutParms.addRule
> > (RelativeLayout.CENTER_HORIZONTAL);
> >             lProgressMsgLayoutParms.addRule(RelativeLayout.BELOW, 4);
> >             mProgressMessage.setLayoutParams(lProgressMsgLayoutParms);
> >             mProgressMessage.setTextColor(Color.LTGRAY);
> >             mProgressMessage.setTextSize(TypedValue.COMPLEX_UNIT_PT, 8);
> >             mProgressMessage.setText("...");
> >             lRelLayout.addView(mProgressMessage);
> >         }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Advice Needed on Application Approach

2009-11-04 Thread Tabibito
What I mean is that I start the service when I receive a
"BOOT_COMPLETED" message from the system.  Immediately upon starting
my service, onCallStateChanged() is called with a state of "idle".  No
calls have come in, I haven't even touched the emulator... I'm
assuming that it's happening because the call state started out as
undefined, and when the system got around to filling it in with
"idle", my service was already listening, and therefore got notified
of the change (this is only a guess - I could be way off on this...).
If I could figure out what it changed FROM, that would be useful.  I
could also probably sense this initial anomaly with some sort of
persistent state variable, and the first time onCallStateListener is
called, set the variable and ignore the state change, then every
future calling of onCallStateListener would look at that variable to
see if it was set... but that sounds like a really messy approach for
something that probably has a much cleaner solution.

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


[android-developers] Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
So I am slowly trying to figure out maps... I want to be able to click
on a point and pop up a message. Toast seemed the way to go. So I
added an "onTap" handler in my class that extends ItemizedOverlay (the
class is called HelloItemizedOverlay) and then tried to grab the Toast
example... But I am seeing Eclipse tell me that the line is in error
no matter what I do... My code is below - could someone tell me what i
am doing wrong?

protected boolean onTap(int index) {
Toast.makeText(HelloItemizedOverlay.this, "TEST",
Toast.LENGTH_SHORT).show();
return super.onTap(index);
}

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


Re: [android-developers] Toast - I can't get it to work in Eclipse...

2009-11-04 Thread Mark Murphy
furby wrote:
> So I am slowly trying to figure out maps... I want to be able to click
> on a point and pop up a message. Toast seemed the way to go. So I
> added an "onTap" handler in my class that extends ItemizedOverlay (the
> class is called HelloItemizedOverlay) and then tried to grab the Toast
> example... But I am seeing Eclipse tell me that the line is in error
> no matter what I do... My code is below - could someone tell me what i
> am doing wrong?
> 
> protected boolean onTap(int index) {
>   Toast.makeText(HelloItemizedOverlay.this, "TEST",
> Toast.LENGTH_SHORT).show();
> return super.onTap(index);
> }
> 

And the error Eclipse gives you is...what?

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

App Widgets Deep Dive Seminar, 27 January 2010: http://bit.ly/deepdive

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


Re: [android-developers] Does Google think developers are lowest life form?

2009-11-04 Thread Disconnect
..do you have some sort of evidence that they shut down cyrket?

On Wed, Nov 4, 2009 at 1:14 AM, tomei.ninge...@gmail.com
 wrote:
> What purported to be a web company doesn't even let developers see
> user comments from the so-called Developer Console.
>
> Now they shut down Cryket.
>
> What the fiick?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
It underlines the "makeText" word and when I ask it for suggestions
all it says is "Rename in file".

Which makes me wonder if, perhaps, "makeText' no longer exists in the
Toast object?

On Nov 4, 10:38 am, Mark Murphy  wrote:
> furby wrote:
> > So I am slowly trying to figure out maps... I want to be able to click
> > on a point and pop up a message. Toast seemed the way to go. So I
> > added an "onTap" handler in my class that extends ItemizedOverlay (the
> > class is called HelloItemizedOverlay) and then tried to grab the Toast
> > example... But I am seeing Eclipse tell me that the line is in error
> > no matter what I do... My code is below - could someone tell me what i
> > am doing wrong?
>
> > protected boolean onTap(int index) {
> >    Toast.makeText(HelloItemizedOverlay.this, "TEST",
> > Toast.LENGTH_SHORT).show();
> >         return super.onTap(index);
> > }
>
> And the error Eclipse gives you is...what?
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> App Widgets Deep Dive Seminar, 27 January 2010:http://bit.ly/deepdive

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Thanks, I will check it out



On Nov 4, 9:19 pm, Mark Murphy  wrote:
> jax wrote:
> > Thanks it worked, I changed it to
>
> >                 if(!item.contains("100%")) {
> >                    tv.setTextColor(Color.RED);
> >                 }
> >                 else {
> >                    tv.setTextColor(Color.BLACK);
> >                 }
>
> > but I still don't understand why...
>
> > Do you know any sites that explain about recycling views?
>
> http://commonsware.com/Android/excerpt.pdf
>
> That is an excerpt from one of my books that talks about the process.
>
> Remember that the view you are recycling once held a row. Android does
> not somehow magically reset those rows to their original look. Hence, if
> you changed the color before, you may have to change it back.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

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


Re: [android-developers] Re: Android 2.0 SDK is here!

2009-11-04 Thread Disconnect
Thats not 2.0.

ISTR 2.0 sources are tagged, but only the bare minimum to cover the
sdk gpl requirements.

On Wed, Nov 4, 2009 at 6:28 AM, Nishant  wrote:
> Hi,
>
> You can download source code from:
>
> http://android.git.kernel.org/?p=platform/dalvik.git;a=tree;hb=HEAD
>
> Thanks & Regards,
> Nishant Shah
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
To be sure that you have some idea of what I am talking about, here is
the code for the entire class :

import java.util.ArrayList;

import android.graphics.drawable.Drawable;
import android.widget.Toast;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class HelloItemizedOverlay extends ItemizedOverlay {
private ArrayList mOverlays = new ArrayList
();

public HelloItemizedOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
}

@Override
protected OverlayItem createItem(int i) {
  return mOverlays.get(i);
}


@Override
public int size() {
return mOverlays.size();
}

public void addOverlay(OverlayItem overlay) {
mOverlays.add(overlay);
populate();
}

protected boolean onTap(int index) {
Toast.makeText(HelloItemizedOverlay.this, "TEST",
Toast.LENGTH_SHORT).show();
return super.onTap(index);
   }
}


On Nov 4, 10:52 am, furby  wrote:
> It underlines the "makeText" word and when I ask it for suggestions
> all it says is "Rename in file".
>
> Which makes me wonder if, perhaps, "makeText' no longer exists in the
> Toast object?
>
> On Nov 4, 10:38 am, Mark Murphy  wrote:
>
> > furby wrote:
> > > So I am slowly trying to figure out maps... I want to be able to click
> > > on a point and pop up a message. Toast seemed the way to go. So I
> > > added an "onTap" handler in my class that extends ItemizedOverlay (the
> > > class is called HelloItemizedOverlay) and then tried to grab the Toast
> > > example... But I am seeing Eclipse tell me that the line is in error
> > > no matter what I do... My code is below - could someone tell me what i
> > > am doing wrong?
>
> > > protected boolean onTap(int index) {
> > >    Toast.makeText(HelloItemizedOverlay.this, "TEST",
> > > Toast.LENGTH_SHORT).show();
> > >         return super.onTap(index);
> > > }
>
> > And the error Eclipse gives you is...what?
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > App Widgets Deep Dive Seminar, 27 January 2010:http://bit.ly/deepdive

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Actually Mark I went to buy your book on Amazon the other day and it
is $417.24 ...???

The Busy Coder's Guide to Android Development by Mark L. Murphy
(Paperback - Feb 6, 2009)
1 new from $417.24.

What is with that?

Is there another way to buy it?  I am not in the US.






On Nov 4, 10:53 pm, jax  wrote:
> Thanks, I will check it out
>
> On Nov 4, 9:19 pm, Mark Murphy  wrote:
>
> > jax wrote:
> > > Thanks it worked, I changed it to
>
> > >                 if(!item.contains("100%")) {
> > >                    tv.setTextColor(Color.RED);
> > >                 }
> > >                 else {
> > >                    tv.setTextColor(Color.BLACK);
> > >                 }
>
> > > but I still don't understand why...
>
> > > Do you know any sites that explain about recycling views?
>
> >http://commonsware.com/Android/excerpt.pdf
>
> > That is an excerpt from one of my books that talks about the process.
>
> > Remember that the view you are recycling once held a row. Android does
> > not somehow magically reset those rows to their original look. Hence, if
> > you changed the color before, you may have to change it back.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > Android Consulting/App Development:http://commonsware.com/consulting
>
>

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


Re: [android-developers] Re: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread Mark Murphy
furby wrote:
> To be sure that you have some idea of what I am talking about, here is
> the code for the entire class :
> 
> import java.util.ArrayList;
> 
> import android.graphics.drawable.Drawable;
> import android.widget.Toast;
> 
> import com.google.android.maps.ItemizedOverlay;
> import com.google.android.maps.OverlayItem;
> 
> public class HelloItemizedOverlay extends ItemizedOverlay {
>   private ArrayList mOverlays = new ArrayList
> ();
> 
>   public HelloItemizedOverlay(Drawable defaultMarker) {
>   super(boundCenterBottom(defaultMarker));
>   }
> 
>   @Override
>   protected OverlayItem createItem(int i) {
> return mOverlays.get(i);
>   }
> 
> 
>   @Override
>   public int size() {
>   return mOverlays.size();
>   }
> 
>   public void addOverlay(OverlayItem overlay) {
>   mOverlays.add(overlay);
>   populate();
>   }
> 
>   protected boolean onTap(int index) {
>   Toast.makeText(HelloItemizedOverlay.this, "TEST",
> Toast.LENGTH_SHORT).show();
> return super.onTap(index);
>}
> }

The first parameter to makeText() needs to be a Context, such as an
Activity.

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


Re: [android-developers] Re: Subclass of ArrayAdapter not working

2009-11-04 Thread Mark Murphy
jax wrote:
> Actually Mark I went to buy your book on Amazon the other day and it
> is $417.24 ...???
> 
> The Busy Coder's Guide to Android Development by Mark L. Murphy
> (Paperback - Feb 6, 2009)
> 1 new from $417.24.
> 
> What is with that?
> 
> Is there another way to buy it?  I am not in the US.

_The Busy Coder's Guide to Android Development_ is not in print -- I
licensed print rights to Apress, which publishes it as _Beginning Android_.

The excerpt is from Version 2.1 of the *digital* edition of _The Busy
Coder's Guide to Android Development_, available via the Warescription
program for 35 USD:

http://commonsware.com/warescription

If you have additional questions about the books and such, post them on
the [cw-android] Google Group, so we keep [android-developers] clear for
Android Q&A:

http://groups.google.com/group/cw-android

Thanks for your interest!

-- 
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] data in xml res/raw

2009-11-04 Thread stephane.cast...@gmail.com
Hi !
I want to get the string in my xml and create button with this text.
But my code (below) doesn't work. I don't know why? there is an
exception : String array resource id #0x7F040
android.content.resources$NotFoundException: String array


Morever, I have used this method to store my data. But i 'd like to
know how save more data in this raw/files.

Thanks

Java:

 String[] myShowName = this.getResources().getStringArray
(R.raw.seriesname);

  Log.i("US Finder", "serie "+myShowName[0]);

  //for each element in xml create button
  for (int i=0; ihttp://groups.google.com/group/android-developers?hl=en


[android-developers] Override in call-screen - Security Bug or Feature?

2009-11-04 Thread Jarman
I just had a private mail-discussion with Dianne Hackborn and he asked
me to put this issue on the Developer forum for further discussion.

I have managed to override the in-call screen from the Java API (i.e.
not modifying the source).
(If you want to se it happen, download Jarmans ReverseLookup from the
Market, it´s free)

Reply from Dianne:
>> It can't be done in a supportable way without modifying the source.  I don't 
>> know how you went about your
>> solution, but there is probably a good chance that it would be broken in a 
>> future version of the platform.  Actually >> there could even be a chance of 
>> it bring deliberately broken if security concerns get raised (disrupting the
>> standard in-call information like this without the user approving is 
>> something that is likely to get filed as a
>> security bug in the platform).

What do think about this?

Best Regards
Jarman

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 avoid change in the screen brightness when changing the screen form portrait to landscape mode and vice versa...

2009-11-04 Thread Girish
Hi All...
   Whenever the phone screen changes its orientation from
landscape to portrait , or portrait   to landscape, the screen goes
dim and becomes bright (after changing its orientation it becomes
bright). Hot to disable this change of brightness...? please help
me...

-Girish

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


[android-developers] no device

2009-11-04 Thread Libre
Since I upgrade to Android 2.0 my phone does not appear in Eclipse or
in adb, only the emulators, and indepandantly of the Android version
of application ( 1.5 1.6 or naturally 2.0).
Is there something to do with this new version?

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


[android-developers] Issue with playing audio or video from Remote URL (RTSP/HTTP)

2009-11-04 Thread dileep
Hi Friends,

Did anyone try playing audio/video through http/rtsp. I am having a
problem with either of the approach
I am getting an error Command PLAYER_INIT completed with PVMFError
I some cases I got
Command PLAYER_INIT completed with
PVMFErrorContentInvalidForProgressiveDownoload.

Can some one explain what is the problem.
The code snippet I am using is given below...

---
--
VideoView mVideoView = (VideoView) findViewById(-);
 mVideoView.setVideoPath("http://192.168.1.143:8080/3.3gp";);
   mVideoView.setMediaController(new MediaController(this));
   mVideoView.requestFocus();
   mVideoView.start();


The code works fine when I say
mVideoView.setVideoPath("/sdcard/vv.3gp");
but not able to play if I give a rtsp/http urls

In case of http it says PVMFErrorContentInvalid for progressive
download

Can some body tell me what is the problem.
Can you please post the code if someone has been successful in playing
audio/video through http/rtsp.

Thanks & Regards
DileepKumar
mail: dileepkumar.renint...@gmail.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] manually update AppWidgetProvider's onUpdate

2009-11-04 Thread skink
hi,

my custom AppWidgetProvider has onUpdate method where i have logic to
update RemoteViews

it is not periodically updated by system, but rather, i'd like to
trigger onUpdate if something happens (in one of my app Activities).
both custom AppWidgetProvider and Activities i'd like to trigger
update from run with the same UID

i tried some AppWidgetManager's methods, but no luck, finally i ended
with really weird solution: i'm sending broadcast with action
ACTION_APPWIDGET_UPDATE and extras EXTRA_APPWIDGET_IDS which i got
from AppWidgetManager

is it a common way of updating AppWidgetProvider?

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


Re: [android-developers] Issue with playing audio or video from Remote URL (RTSP/HTTP)

2009-11-04 Thread Mark Murphy
dileep wrote:
> In case of http it says PVMFErrorContentInvalid for progressive
> download

At least for HTTP streaming of MP4 content, you need to have your 'moov'
atom before your 'mdat' atom. This may happen automatically when you
create your MP4 files, or you may need to lightly twiddle them (e.g.,
MP4Box -hint on Linux).

> Can you please post the code if someone has been successful in playing
> audio/video through http/rtsp.

vidtry handles HTTP streaming:

http://github.com/commonsguy/vidtry

I wrote that in part as a proof of concept for an app I wrote for a
consulting customer. They have a large library of MP4 files which they
needed to touch up for the issue listed above, and playback basically
did not work in the emulator, but it works fine on devices. The vidtry
sample does more than just play back video, and it uses MediaPlayer
rather than VideoView, but hopefully it will help.

You may be interested in viewing the following presentation from the
2009 Google I/O conference:

http://code.google.com/events/io/2009/sessions/MasteringAndroidMediaFramework.html
http://www.scribd.com/doc/16917356/Mastering-the-Android-Media-Framework

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


Re: [android-developers] manually update AppWidgetProvider's onUpdate

2009-11-04 Thread Mark Murphy
skink wrote:
> hi,
> 
> my custom AppWidgetProvider has onUpdate method where i have logic to
> update RemoteViews
> 
> it is not periodically updated by system, but rather, i'd like to
> trigger onUpdate if something happens (in one of my app Activities).
> both custom AppWidgetProvider and Activities i'd like to trigger
> update from run with the same UID
> 
> i tried some AppWidgetManager's methods, but no luck, finally i ended
> with really weird solution: i'm sending broadcast with action
> ACTION_APPWIDGET_UPDATE and extras EXTRA_APPWIDGET_IDS which i got
> from AppWidgetManager
> 
> is it a common way of updating AppWidgetProvider?

You could also just send a broadcast to the provider directly, via the
component-name version of the Intent constructor. Look for a null
action, or some extra you package in, or something to tell it is your
own custom Intent, then do the update work.

For example, I have a Twitter widget that has a refresh button using
this technique:

http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/TwitterWidget/

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

Android Training in Germany, 18-22 January 2010: http://bignerdranch.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: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
Hmmm Am I putting the onTap handler in the wrong place? I thought
that it would go in the overlay handler

On Nov 4, 11:01 am, Mark Murphy  wrote:
> furby wrote:
> > To be sure that you have some idea of what I am talking about, here is
> > the code for the entire class :
>
> > import java.util.ArrayList;
>
> > import android.graphics.drawable.Drawable;
> > import android.widget.Toast;
>
> > import com.google.android.maps.ItemizedOverlay;
> > import com.google.android.maps.OverlayItem;
>
> > public class HelloItemizedOverlay extends ItemizedOverlay {
> >    private ArrayList mOverlays = new ArrayList
> > ();
>
> >    public HelloItemizedOverlay(Drawable defaultMarker) {
> >            super(boundCenterBottom(defaultMarker));
> >    }
>
> >   �...@override
> >    protected OverlayItem createItem(int i) {
> >      return mOverlays.get(i);
> >    }
>
> >   �...@override
> >    public int size() {
> >            return mOverlays.size();
> >    }
>
> >    public void addOverlay(OverlayItem overlay) {
> >        mOverlays.add(overlay);
> >        populate();
> >    }
>
> >    protected boolean onTap(int index) {
> >            Toast.makeText(HelloItemizedOverlay.this, "TEST",
> > Toast.LENGTH_SHORT).show();
> >         return super.onTap(index);
> >    }
> > }
>
> The first parameter to makeText() needs to be a Context, such as an
> Activity.
>
> --
> 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


Re: [android-developers] Toast - I can't get it to work in Eclipse...

2009-11-04 Thread FFEH
Maybe you can try to use Toast.LENGTH_LONG

On Wed, Nov 4, 2009 at 11:32 PM, furby  wrote:

> So I am slowly trying to figure out maps... I want to be able to click
> on a point and pop up a message. Toast seemed the way to go. So I
> added an "onTap" handler in my class that extends ItemizedOverlay (the
> class is called HelloItemizedOverlay) and then tried to grab the Toast
> example... But I am seeing Eclipse tell me that the line is in error
> no matter what I do... My code is below - could someone tell me what i
> am doing wrong?
>
> protected boolean onTap(int index) {
>Toast.makeText(HelloItemizedOverlay.this, "TEST",
> Toast.LENGTH_SHORT).show();
>return super.onTap(index);
> }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: The mysterious disappearing progress bar...

2009-11-04 Thread dadical
Hah!  The style for my app is the "light" styled theme, so I bet that
makes the progress bar dark.   Sheesh.  I'll check that out... thanks
for the tip.

On Nov 4, 10:19 am, Mika  wrote:
> I had a similar problem and it was just because the default
> progressbar had changed in Donut and it was all white. So I had a
> white progressbar in a white background. Not sure if that's your
> problem though.
>
> -Mika
>
> On Nov 4, 5:02 pm, dadical  wrote:
>
>
>
> > Anyone have a clue?  I'm guessing it has something to do with changes
> > in Donut related to buffering or optimizing display of Z-Order of
> > views in relative layout, but maybe it's something simpler...
>
> > I'm stacking:
>
> > LinearLayout
> >    RelativeLayout
> >       VideoView  (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
> >       ProgressBar (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
> >       TextView (WRAP_CONTENT, WRAP_CONTENT, BELOW(my progress bar))
>
> > I was counting on relative layout displaying the progress bar and the
> > text view on top of the video view because they were added to the
> > layout after the video view.  That worked in 1.5, but stopped since
> > 1.6.
>
> > On Nov 2, 11:36 pm, dadical  wrote:
>
> > > The following code used to render an indeterminate progress bar with a
> > > message below, all on top of a video view.  Once the video was ready,
> > > the message and the progress bar would be made invisible.  Ever since
> > > cupcake, the progress bar doesn't show at all.  Anyone have any clues?
>
> > > dk
>
> > >         private void setupView() {
> > >                 LinearLayout lLinLayout = new LinearLayout(this);
> > >             lLinLayout.setId(1);
> > >             lLinLayout.setOrientation(LinearLayout.VERTICAL);
> > >             lLinLayout.setGravity(Gravity.CENTER);
> > >             lLinLayout.setBackgroundColor(Color.BLACK);
>
> > >             LayoutParams lLinLayoutParms = new LayoutParams
> > > (ViewGroup.LayoutParams.FILL_PARENT,
> > > ViewGroup.LayoutParams.FILL_PARENT);
> > >             lLinLayout.setLayoutParams(lLinLayoutParms);
>
> > >             this.setContentView(lLinLayout);
>
> > >             RelativeLayout lRelLayout = new RelativeLayout(this);
> > >             lRelLayout.setId(2);
> > >             lRelLayout.setGravity(Gravity.CENTER);
> > >             lRelLayout.setBackgroundColor(Color.BLACK);
> > >             android.widget.RelativeLayout.LayoutParams lRelLayoutParms = 
> > > new
> > > android.widget.RelativeLayout.LayoutParams
> > > (ViewGroup.LayoutParams.FILL_PARENT,
> > > ViewGroup.LayoutParams.FILL_PARENT);
> > >             lRelLayout.setLayoutParams(lRelLayoutParms);
> > >             lLinLayout.addView(lRelLayout);
>
> > >             mVideoView = new VideoView(this);
> > >             mVideoView.setId(3);
> > >             android.widget.RelativeLayout.LayoutParams 
> > > lVidViewLayoutParams =
> > > new android.widget.RelativeLayout.LayoutParams
> > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > >             lVidViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
> > >             mVideoView.setLayoutParams(lVidViewLayoutParams);
> > >             lRelLayout.addView(mVideoView);
>
> > >             mProgressBar = new ProgressBar(this);
> > >             mProgressBar.setId(4);
> > >             android.widget.RelativeLayout.LayoutParams
> > > lProgressBarLayoutParms = new
> > > android.widget.RelativeLayout.LayoutParams
> > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > >             
> > > lProgressBarLayoutParms.addRule(RelativeLayout.CENTER_IN_PARENT);
> > >             mProgressBar.setLayoutParams(lProgressBarLayoutParms);
> > >             lRelLayout.addView(mProgressBar);
>
> > >             mProgressMessage = new TextView(this);
> > >             mProgressMessage.setId(5);
> > >             android.widget.RelativeLayout.LayoutParams
> > > lProgressMsgLayoutParms = new
> > > android.widget.RelativeLayout.LayoutParams
> > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > >             lProgressMsgLayoutParms.addRule
> > > (RelativeLayout.CENTER_HORIZONTAL);
> > >             lProgressMsgLayoutParms.addRule(RelativeLayout.BELOW, 4);
> > >             mProgressMessage.setLayoutParams(lProgressMsgLayoutParms);
> > >             mProgressMessage.setTextColor(Color.LTGRAY);
> > >             mProgressMessage.setTextSize(TypedValue.COMPLEX_UNIT_PT, 8);
> > >             mProgressMessage.setText("...");
> > >             lRelLayout.addView(mProgressMessage);
> > >         }- 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.g

Re: [android-developers] Re: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread Mark Murphy
furby wrote:
> Hmmm Am I putting the onTap handler in the wrong place? I thought
> that it would go in the overlay handler

Your onTap() is in the correct place. However, HelloItemizedOverlay is
not a Context, and so it cannot be used as the first parameter to
makeText().

Either make HelloItemizedOverlay an inner class of your MapActivity, or
pass the MapActivity as a parameter to the HelloItemizedOverlay
constructor, or something, then use that object as the first parameter
to makeText().

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

Android Consulting/App Development: http://commonsware.com/consulting

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
Perhaps I am going about this the wrong way... it seems like a lot of
shifting of code around to get a simple message to display in google
maps.

Let me rephrase the question : Is there a simple way to get the two
String parameters to display (That are sent to the OverlayItem class)
when a point is clicked on? I would assume that google maps woudl have
somethign built in (I am used to using maps in Javascript where it's
pretty much just a onClick event handler...).

You must remember - when it comes to this you can treat me like a
complete idiot - I am starting from the basics of this topic... The
Google "Hello Views" tutorial for maps got me this far but neglected
to explain how to handle a click on a point

On Nov 4, 11:57 am, Mark Murphy  wrote:
> furby wrote:
> > Hmmm Am I putting the onTap handler in the wrong place? I thought
> > that it would go in the overlay handler
>
> Your onTap() is in the correct place. However, HelloItemizedOverlay is
> not a Context, and so it cannot be used as the first parameter to
> makeText().
>
> Either make HelloItemizedOverlay an inner class of your MapActivity, or
> pass the MapActivity as a parameter to the HelloItemizedOverlay
> constructor, or something, then use that object as the first parameter
> to makeText().
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

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


Re: [android-developers] Re: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread Mark Murphy
furby wrote:
> Perhaps I am going about this the wrong way... it seems like a lot of
> shifting of code around to get a simple message to display in google
> maps.

Not really.

> Let me rephrase the question : Is there a simple way to get the two
> String parameters to display (That are sent to the OverlayItem class)
> when a point is clicked on? I would assume that google maps woudl have
> somethign built in (I am used to using maps in Javascript where it's
> pretty much just a onClick event handler...).

You are using the simple way. You just have the wrong type for the first
parameter to the makeText() method. It would similarly fail if you tried
passing an integer for the first parameter, or a boolean.

You can see an example of using a Toast from an ItemizedOverlay in one
of my book examples. I don't have these examples up on github just yet
(probably this weekend), so I can't directly link to it. For now, visit:

http://commonsware.com/Android/

Scroll down and click on the Source Code link opposite the table of
contents. In the ZIP file, you will see Maps/NooYawk/. Look for the
onTap() implementation there.

Since my ItemizedOverlay is an inner class of my MapActivity, I already
have access to a suitable Context to provide to makeText().

-- 
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] Re: Toast - I can't get it to work in Eclipse...

2009-11-04 Thread furby
Thank you! The got my app to display a message to the user! Yay!

And you are about to have a customer!

On Nov 4, 12:14 pm, Mark Murphy  wrote:
> furby wrote:
> > Perhaps I am going about this the wrong way... it seems like a lot of
> > shifting of code around to get a simple message to display in google
> > maps.
>
> Not really.
>
> > Let me rephrase the question : Is there a simple way to get the two
> > String parameters to display (That are sent to the OverlayItem class)
> > when a point is clicked on? I would assume that google maps woudl have
> > somethign built in (I am used to using maps in Javascript where it's
> > pretty much just a onClick event handler...).
>
> You are using the simple way. You just have the wrong type for the first
> parameter to the makeText() method. It would similarly fail if you tried
> passing an integer for the first parameter, or a boolean.
>
> You can see an example of using a Toast from an ItemizedOverlay in one
> of my book examples. I don't have these examples up on github just yet
> (probably this weekend), so I can't directly link to it. For now, visit:
>
> http://commonsware.com/Android/
>
> Scroll down and click on the Source Code link opposite the table of
> contents. In the ZIP file, you will see Maps/NooYawk/. Look for the
> onTap() implementation there.
>
> Since my ItemizedOverlay is an inner class of my MapActivity, I already
> have access to a suitable Context to provide to makeText().
>
> --
> 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] Re: Using MediaPlayer best practices?

2009-11-04 Thread Moto
Thanks Alex!

When you say peek at the MediaPlaybackService you mean android
framework code?

I was afraid that MediaPlayer would somehow end in an invalid state if
the internal server died or something but I guess reset() cleans it
up...  As of now I just use Reset() to stop playback.. :P seems to be
faster than Stop() plus it cleans the MediaPlayer to be ready for
another SetDataSource() and Prepare()...

Something I don't like about MediaPlayer is that you can't get the
audio status!  Say it's progressively playing a file from the internet
and  all the sudden audio stops because it doesn't have enough
data...  I want to know when that happens and there is no information
for that...  Any ideas on this part?

Thanks,
-Moto

On Nov 4, 3:34 am, Alexey Krasnoriadtsev 
wrote:
> Preparing a mediaPlayer is the most expensive operation.
> calling stop() or pause() and then start() works best for me. You can
> also peek at the MediaPlaybackService for inspiration.
>
> Why do you think it will get into the bad state?
>
> On Nov 3, 7:14 pm, Moto  wrote:
>
> > What is the best way to use the MediaPlayer when needed multiple
> > times?
>
> > Reuse the instantiated MediaPlayer throughout the session?  Or
> > constantly stop() release() and instantiate a new MediaPlayer() ?
>
> > If I reuse I'm afraid the player could be in a bad state?
> > What about performance wise? what's better? reuse or renew?
>
> > Note: This is for using as a music player so one audio be present at
> > one given time...
>
> > Thank!
> > -Moto!

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


[android-developers] server callbacks to mobile client

2009-11-04 Thread VY
Hi:

I am trying to implement a service that server needs to, on occasions, make
contacts with mobile client.
Is SMS the only possible server -> client callback mechanism?  Is there
another way?

And for SMS, is the best way to send SMS is by way of email -> SMS (sending
email to pho...@provider.com)?

Thanks for any tips in advance.

--Vincent

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

[android-developers] Draw GLSurfaceView to a Bitmap

2009-11-04 Thread yammada
I have an application that uses GLSurfaceView to draw OpenGL ES
graphics.  This is all working (mostly) how I would expect.

Now, I would like to implement a screenshot feature.  For normal
views, it seems that the standard practice is to create a new Canvas
with a Bitmap and then draw to that Canvas using View.onDraw(Canvas).

I've tried using SurfaceView.draw(Canvas) in a similar fashion, but it
always results in a blank (black) image.

I've also tried using the drawing cache with the exact same result.

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: Audio Playback while Recording... ------- attemp playback while recording, cheat it! ----- error

2009-11-04 Thread Moto
Can you just do the following?

byte []buf = new byte[1024];
int read = 0;

ar = new AudioRecord();
at = new AudioTrack();

do {
//Read from mic
read = ar.read(buf);

//Send to speaker
at.write(buf,0,read);

} while(...);


-Moto

On Oct 22, 5:00 am, Vishal  wrote:
> Thanks Roman,
>
> But my scenario is quiet different from what is discussed in that
> blog. I am trying to capture audio from mic directly in pcm format
> using AudioRecord interface and also at the same time trying to play
> the pcm samples (from different source) to the speaker using the
> AudioTrack interface. That is when I am getting this error " ---
> attemp playback while recording, cheat it! -  ".
>
> Please let me know if you find any other thread?
> Thanks,
> Vishal Gaonkar
>
> On Oct 17, 2:26 am, "Roman ( T-Mobile USA)" 
> mobile.com> wrote:
> > I am assuming when you record your audio stream, the file is blocked
> > from playback.
>
> > Check out the following blog which talks about video streaming and
> > deals with a similar problem
>
> >http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-stream...
>
> > --
> > 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 Oct 16, 5:20 am, Vishal  wrote:
>
> > > Hello,
>
> > > I have a Java application where in I am trying to read Audio samples
> > > from the mic into a buffer and then write the samples back to speaker
> > > from a buffer for playing.
>
> > > I have used AudioRecord and AudioTrack interfaces. Below are my
> > > configurations for the Record and Track object creation. AudioTrack(0,
> > > 8000, 2, 2, playBufSize, 1); AudioRecord(1, 8000, 2, 2, recBufSize);
> > > Using AudioRecord interface I am able to read the samples from mic
> > > continiously (8000 sampling rate and 640 samples per read). In the
> > > similar way I am also able to write some pcm samples to the speaker
> > > from a buffer and play it continuously using the AudioTrack interface
> > > (without record).
>
> > > But when I try to do both record and play simultaneously I am able to
> > > only record audio from mic but I am not able to play any samples to
> > > speaker. I am getting this error " --- attemp playback while
> > > recording, cheat it! -  " in the log cat.
>
> > > I have given the following permissions
> > > "android.permission.RECORD_AUDIO" and
> > > "android.permission.MODIFY_AUDIO_SETTINGS" in the Manifest file. I
> > > didn't find any special permission to play the audio.
>
> > > Is there anything else that I need to enable?
>
> > > Thanks in advance,
> > > Vishal

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


[android-developers] Re: Different versions of searchable.xml for different sdk targets?

2009-11-04 Thread Perty
Thanks!

Worked like a charm.

/Perty


On 3 Nov, 17:17, Romain Guy  wrote:
> The syntax is xml-v4/, with a dash instead of an underscore.
>
>
>
> On Tue, Nov 3, 2009 at 1:55 AM, Perty  wrote:
> > Hi!
>
> > I have  implemented a SearchManager which make uses of a
> >searchable.xmlwith all the settings and put it in the xml/ directory.
>
> > I tried to create a new directory called xml_v4/ to add some
> > attributes (the android:includeInGlobalSearch ie) which isn't
> > supported in sdk3/1.5 but the xml directory seems not to be supported
> > by the dir_suffixes.
>
> > How do I deal with this? Someone have any suggestions?
>
> > I want to have one binary for different targets.
>
> > Regards Perty
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 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


Re: [android-developers] data in xml res/raw

2009-11-04 Thread Dianne Hackborn
R.raw is almost certainly not going to be a string array.  You need to
define a string array in values/.xml, with the following markup:



string1
string2



On Wed, Nov 4, 2009 at 12:57 AM, stephane.cast...@gmail.com <
stephane.cast...@gmail.com> wrote:

> Hi !
> I want to get the string in my xml and create button with this text.
> But my code (below) doesn't work. I don't know why? there is an
> exception : String array resource id #0x7F040
> android.content.resources$NotFoundException: String array
>
>
> Morever, I have used this method to store my data. But i 'd like to
> know how save more data in this raw/files.
>
> Thanks
>
> Java:
>
> String[] myShowName = this.getResources().getStringArray
> (R.raw.seriesname);
>
>  Log.i("US Finder", "serie "+myShowName[0]);
>
>  //for each element in xml create button
>  for (int i=0; i  {
>   Log.i("US Finder", "serie "+myShowName[i]);
>   _btn[i]= new Button(this);
>   _btn[i].setText(myShowName[i]);
>   _btn[i].setGravity(Gravity.CENTER_HORIZONTAL);
>   _btn[i].setOnClickListener(this);
>   myLayout.addView(_btn[i]);
>  }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

Re: [android-developers] Re: Stable contact identity & CONTENT_LOOKUP_URI

2009-11-04 Thread Dmitri Plotnikov
Hi Richard,

I can tell you what we did when we faced a similar requirement.  We needed
to store things like custom ringtone, "straight-to-voicemail" etc on a
per-contact basis.  What we ended up doing is simply replicating this
information into each raw contact in the aggregate. When raw contacts are
re-aggregated, we use a heuristic to figure out the values for the entire
aggregate (e.g. if one of the raw contacts has straight-to-voicemail=false,
then the entire contact has straight-to-voicemail=false).

I would do the same in your case.  You can always get _ids of all raw
contacts in an aggregate contact and then in your database have a row for
each of those raw contacts.   To retrieve the information for an aggregate
contact, you would pull it for all constituent raw contacts and use an
algorithm to "aggregate" the data.

Does that make sense?

Cheers,
- Dmitri

On Wed, Nov 4, 2009 at 4:45 AM, jarkman  wrote:

> Dmitri - thanks - that's perfect.
>
> So, we have two choices -
>
> (1) For each incoming contact URI, loop over our table of stored
> lookup keys, looking each one up with
> ContactsContract.Contacts.lookupContact(resolver, lookupUri) and
> comparing with the incoming contact.
>
> I think that will be reliable, and makes the best use of your cunning
> lookup mechanisms, but could be a performance problem.
>
>
> (2) Move our custom data into the generic data store in the contacts
> database ( as hinted at here:
>
> http://groups.google.com/group/android-developers/browse_thread/thread/690cd4e531205b0c/364e21a52b00491c?lnk=gst&q=contacts#364e21a52b00491c
> )
>
> That should be reliable, but I am not sure what will happen to the
> generic data rows over contact aggregation and disaggregation.
> Presumably we may find a contact who has two instances of our custom
> data (after aggregation) or none (after disaggregation, if our custom
> data stayed with the other half of the results).
>
>
> (3) In our own table, keep all the raw contact IDs for each aggregated
> contact we are interested in. That lets us deal with the aftermath of
> aggregation and disaggregation explicitly, and it lets us search
> quickly by comparing IDs, but it means we need to do something
> complicated to clean up our data after a disaggregation has has
> happened.
>
> Do you think that covers it ?
>
>
> Richard
>
> On Nov 3, 7:17 pm, Dmitri Plotnikov  wrote:
> > Hi Richard,
> >
> > Lookup key is unique at any point in time.  It's not unique over time.
> >
> > The anatomy of a lookup key is basically this.  If an aggregate contact
> has
> > three raw contacts with server-side IDs "A", "B" and "C", the lookup key
> > will effectively be  accountA/A.accountB/B.accountC/C
> >
> > We don't attempt to find a contact with that exact lookup key.  We
> actually
> > parse it, find all those three raw contacts and infer the id of the new
> > contact ID, which will be the one containing the most of the original raw
> > contacts. In other words, even though the result is a bit unpredictable,
> the
> > user shouldn't be surprised by what they see.  The original contact had
> A, B
> > and C - now I am looking at something that has either A or B or C or a
> > couple of those or maybe A,B,C and D.
> >
> > You are right that you should not use lookup keys to compare contact
> > identities to each other.  You can use the
> > ContactsContract.Contacts.lookupContact(resolver, lookupUri) method,
> which
> > will give you the current contact ID for your contact.  Be careful though
> -
> > between the moment you get it and the moment you use it the contact may
> > change.  Any kind of background sync could cause this change to happen.
>  I
> > would try to design the software in such a way that either doesn't need
> to
> > do this type of resolution or uses something even more robust than lookup
> > keys, e.g. raw contact IDs.
> >
> > I hope this helps,
> > - Dmitri
> >
> > On Tue, Nov 3, 2009 at 6:40 AM, jarkman  wrote:
> > > Oh - one more question:
> >
> > > Am I right in thinking that the lookup URI is not itself a unique,
> > > stable identifier ? That is, the lookup URI for one contact may be
> > > different at different times.
> >
> > > Right now, we store some contact row IDs in a table, along with per-
> > > contact settings of our own. We use a WHERE clause on the contact ID
> > > to pull out the settings for a particular contact.
> >
> > > If we store lookup URIs in the table, and want to find some current
> > > contact in that table, we cannot do it by comparing lookup URIs
> > > directly, because the lookup URI for the target contact may have
> > > changed since we wrote the table. If we want to compare two lookup
> > > URIs to see if they refer to the same person, we need to look them
> > > both up in the contacts table and see if they have the same record ID
> > > right now. Is that right ?
> >
> > > Thanks,
> >
> > > Richard
> >
> > > On Nov 2, 5:32 pm, Dmitri Plotnikov  wrote:
> > > > Hi Richard,
> >
> > > > You are exactly right.  I

[android-developers] Re: Trouble Rendering Bitmaps Correctly in OpenGL

2009-11-04 Thread Lance Nanek
I don't need the invite, but I did run into something similar on an
OpenGL project I'm working on. One of my textures faded out to
transparent on one side. A row of pixels that were partially
transparent there were getting rendered darker than they should.
Fortunately for me I only ever draw that texture on one color
background anyway, so was able to just ditch the transparency for a
quick fix.

Anyway, looking into it a bit more, maybe it was an issue with
premultiplied alpha as per this post:
http://groups.google.com/group/android-developers/msg/08ef8d0318ce512b

It does mention a symptom being "dark halos around all of your
sprites". Might be worth trying the quick change to the
glBlendFunction arguments.

On Nov 4, 7:30 am, abowman  wrote:
> If you can solve my problem, I'll send you a Google Wave invite.  :)
>
> On Nov 2, 6:39 am, abowman  wrote:
>
> > I'm basically using the same method of loading bitmaps inOpenGLthat
> > the SpriteMethodTest example uses and have been unable to get rid of
> > an annoying outline that appears around all of my images.
>
> > For example, If I were to load an image of a  white circle on a white
> > background, I would expect to see nothing.  Instead, I would see my
> > circle because its edge would be gray.  In SpriteMethodTest, I
> > replaced the background image with white and was able to see that the
> > edges of the android images flying around also don't seem to be
> > rendered correctly.
>
> > Does anyone know how to load images inOpenGLwithout having a thin
> > outline appear around the images?

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


Re: [android-developers] manually update AppWidgetProvider's onUpdate

2009-11-04 Thread skink


Mark Murphy wrote:
> skink wrote:
> > hi,
> >
> > my custom AppWidgetProvider has onUpdate method where i have logic to
> > update RemoteViews
> >
> > it is not periodically updated by system, but rather, i'd like to
> > trigger onUpdate if something happens (in one of my app Activities).
> > both custom AppWidgetProvider and Activities i'd like to trigger
> > update from run with the same UID
> >
> > i tried some AppWidgetManager's methods, but no luck, finally i ended
> > with really weird solution: i'm sending broadcast with action
> > ACTION_APPWIDGET_UPDATE and extras EXTRA_APPWIDGET_IDS which i got
> > from AppWidgetManager
> >
> > is it a common way of updating AppWidgetProvider?
>
> You could also just send a broadcast to the provider directly, via the
> component-name version of the Intent constructor. Look for a null
> action, or some extra you package in, or something to tell it is your
> own custom Intent, then do the update work.
>

thank you Mark,

this is exactly what i'm doing now - sending broadcast directly to my
AppWidgetProvider by manually creating proper Intent and adding some
EXTRA_APPWIDGET_IDS extras

yet my impression was that this is not the way one should do: i mean i
thought there must be some higher level helper method to update
AppWidgetProvider

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: Where put file with data?

2009-11-04 Thread stephane.cast...@gmail.com
I think the /res/values are writable.
I try this solution.
thanks

On 2 nov, 19:01, Wojciech Topolski 
wrote:
> Hi
>
> I have a problem with files. I would like to add file with database inserts
> to my app. Where should I put this file? In res/then? This file will have 5
> MB, so after operation I would like to remove it from system. I know about
> /res/raw/file, but this file is only readably by InputStream importSql =
> res.openRawResource(R.raw.import_sql);
>
> Best regards.
>
> --
> ===
> Wojciech Topolski
> wojciech.topol...@gmail.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: Advice Needed on Application Approach

2009-11-04 Thread James
It seems like a shame if you need to code around this, but you could
do it a little cleaner, as you suggested.  I would suggest you simply
keep your own preference variable that records the 'last' state it
knew about defaulting it to idle when your application first
initializes.  Then on the state change simply check the state is
different from before before you take any action on the state change.
This is mostly the same approach as you proposed with the benefit it
treats all state changes as suspect.  This gives a more robust error
checking if any other state change quirks happen in which you might
get duplicate notifications.

Still I don't like the idea you have to have that persistent variable,
at least this solution has a tad more purpose.


On Nov 4, 8:32 am, Tabibito  wrote:
> What I mean is that I start the service when I receive a
> "BOOT_COMPLETED" message from the system.  Immediately upon starting
> my service, onCallStateChanged() is called with a state of "idle".  No
> calls have come in, I haven't even touched the emulator... I'm
> assuming that it's happening because the call state started out as
> undefined, and when the system got around to filling it in with
> "idle", my service was already listening, and therefore got notified
> of the change (this is only a guess - I could be way off on this...).
> If I could figure out what it changed FROM, that would be useful.  I
> could also probably sense this initial anomaly with some sort of
> persistent state variable, and the first time onCallStateListener is
> called, set the variable and ignore the state change, then every
> future calling of onCallStateListener would look at that variable to
> see if it was set... but that sounds like a really messy approach for
> something that probably has a much cleaner solution.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: App name/icon problems on Hero after reboot

2009-11-04 Thread fadden
On Nov 3, 10:58 am, gdonald  wrote:
> So Diane is saying this is not a generic Android platform bug because
> it's only on HTC Heros, and then HTC is denying the bug exists even
> though many people in this very thread say they are experiencing it
> and can reproduce it.


If the problem can be reproduced on Hero phones by a range of users,
and doesn't happen on any other Android device, then it's pretty
clearly a problem with Hero phones.  It might not be HTC's fault, but
it's affecting their customers, so they're in the hot seat.

Software has bugs, and when the developers can't reproduce them it's
harder to sort out.  (The reply says "unable to replicate", not "don't
believe it exists", though the following couple of sentences suggest
the rep is moving on.)  My advice to everyone in this thread is: if
you are experiencing this problem, file a bug report with HTC, with as
much detail as you can manage.  Hopefully a pattern will emerge that
will allow them to isolate and reproduce the problem, and if it's in
their stuff, provide a fix.

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


Re: [android-developers] no device

2009-11-04 Thread Disconnect
What phone?

On Wed, Nov 4, 2009 at 5:20 AM, Libre  wrote:
> Since I upgrade to Android 2.0 my phone does not appear in Eclipse or
> in adb, only the emulators, and indepandantly of the Android version
> of application ( 1.5 1.6 or naturally 2.0).
> Is there something to do with this new version?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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


Re: [android-developers] Override in call-screen - Security Bug or Feature?

2009-11-04 Thread Disconnect
Didn't the whitepages app come out in the very very first days of the
market with this capability? (I didn't use it much, at the time there
was no 3g in this area. Plus, submitting incoming phone #s to a 3rd
party service was really skeevy.)

As an aside, Dianne is a girl's name. :)

On Wed, Nov 4, 2009 at 10:47 AM, Jarman  wrote:
> I just had a private mail-discussion with Dianne Hackborn and he asked
> me to put this issue on the Developer forum for further discussion.
>
> I have managed to override the in-call screen from the Java API (i.e.
> not modifying the source).
> (If you want to se it happen, download Jarmans ReverseLookup from the
> Market, it´s free)
>
> Reply from Dianne:
>>> It can't be done in a supportable way without modifying the source.  I 
>>> don't know how you went about your
>>> solution, but there is probably a good chance that it would be broken in a 
>>> future version of the platform.  Actually >> there could even be a chance 
>>> of it bring deliberately broken if security concerns get raised (disrupting 
>>> the
>>> standard in-call information like this without the user approving is 
>>> something that is likely to get filed as a
>>> security bug in the platform).
>
> What do think about this?
>
> Best Regards
> Jarman
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Low level audio really needed - too much latency in SoundPool, AudioTrack for more real time stuff

2009-11-04 Thread James
You're going to get lag simply from touching the screen and waiting
for the message go to the registered handler.  So, first of all, I
would make sure any user activity actions be bound to direct hardware
interactions such as sensors and hardware key presses vs. UI screen
button presses.  However you'll need to remember on an embedded device
(and the emulator) your dalvik coded response handlers will most
likely have a larger lag then you would expect if Dalvik was running
on a better piece of hardware.

Of course, that doesn't address the additional lag from the available
API's from within Dalvik and playing sound.  I think ideally your
solution there would be to write your own JNI pass through to native
calls and then you should be able to get low level access to the sound
library api's.  I am not sure if the native API's are documented or
not, but it is probably the alsa api's.  Unfortunately witting the
native code isn't trivial and you would have to cross compile binaries
that would work with the hardware you expect your apps to work on,
most of the embedded hardware out there is ARM.

There might be a way to use the current API's to shorten the buffer
time, but I don't know.

On Oct 26, 2:17 am, niko20  wrote:
> Ok I first have to say that I'm biased, 'cus I like to write music
> apps (like music generation apps). However, this affects games as
> well.
>
> It's somewhat disappointing how OpenGL has made it into the NDK now
> but there isn't any NDK methods to get to sound to have faster access.
> Over the weekend I did some more testing and if you make a "drum" app,
> for example, and play the sound using eitherSoundPoolor AudioTrack,
> you will get about a 100ms delay buffer, which is clearly audible
> (gap).
>
> I made  a test app where when you touch the screen, upon the DOWN
> event, it would play a short sound (like a drum sound). It clearly was
> not real time responsive or even close - you could hear the delay.
>
> I'd be interested to know if anyone who has made a game has any
> trouble with sounds? It seems like they aren't going to really trigger
> real time enough if you useSoundPool, for example. Am I completely
> wrong? Seems like your game is going to perform an action, play a
> sound, but the sound will have latency which I would think would throw
> off the game a bit.
>
> I tested to see if it perhaps was just the touch event itself that was
> slow - I added code to change the background color of the app when you
> touch down, and then change it back when you let up. The color changed
> almost instantaneously. So it's not the event handling, but rather,
> the sound objects that have the delay issues.
>
> I found that if I used AudioTrack (I tried it in streaming mode so I
> had more control over buffer size), it wouldn't allow me to create the
> object unless the buffer was at least 2048 samples in size (for the
> format I was using whic was I think 22050 mono 16 bit - this would
> work out to almost 100ms buffer before the track begins to play), and
> strangely I found that the amount of buffer must have been the same
> forSoundPoolsince when loaded with the same sound, the delay was
> similar. I also tried AudioTrack in static mode and it still had the
> same delay asSoundPool, or using AudioTrack in stream mode too!
>
> To get really good audio response we need to get down to the 30ms
> delay range or so (obviously the faster the better), the iphone does
> this with it's AudioUnit objects (of course they are in native code,
> which you write in C).
>
> I just hope that by the time we get to Flan, we may have NDK audio
> access, and hopefully we can get more direct audio streams for some
> real processing power.
>
> Hasn't this affected games much? I would think it would still be a
> problem in games even now, with latency so high. Even though the docs
> saySoundPooland static AudioTrack will have lowest latency possible,
> it still seems high to me.
>
> -niko

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


Re: [android-developers] Re: App name/icon problems on Hero after reboot

2009-11-04 Thread Mark Murphy
fadden wrote:
> My advice to everyone in this thread is: if
> you are experiencing this problem, file a bug report with HTC, with as
> much detail as you can manage.  Hopefully a pattern will emerge that
> will allow them to isolate and reproduce the problem, and if it's in
> their stuff, provide a fix.

Specifically, unless somebody finds a better answer, HTC's developer
site offers AndroidSupport /at\ htc.com (with an appropriate punctuation
substitution there) as a contact point.

While that address is on a page regarding QVGA and the Tattoo, I am not
aware of any other HTC channel dedicated to developer support. If
somebody finds a better venue, chime in!

Please provide the ROM version your Hero has, along with pointers to
apps that are exhibiting the problem, and (as fadden indicated) any
other details you can think of.

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

App Widgets Deep Dive Seminar, 27 January 2010: http://bit.ly/deepdive

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Where put file with data?

2009-11-04 Thread WoodManEXP
/sdcard/ works well.

On Nov 2, 1:01 pm, Wojciech Topolski 
wrote:
> Hi
>
> I have a problem with files. I would like to add file with database inserts
> to my app. Where should I put this file? In res/then? This file will have 5
> MB, so after operation I would like to remove it from system. I know about
> /res/raw/file, but this file is only readably by InputStream importSql =
> res.openRawResource(R.raw.import_sql);
>
> Best regards.
>
> --
> ===
> Wojciech Topolski
> wojciech.topol...@gmail.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] GPS_EVENT_SATELLITE_STATUS called alot

2009-11-04 Thread WoodManEXP
Has anyone noticed that onGpsStatusChanged for event
GPS_EVENT_SATELLITE_STATUS is called alot? As far as I can tell it
seems to be called continously. Is that expected?

Thank you!

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


[android-developers] get absolute screen position

2009-11-04 Thread sdphil
View.getLeft() and View.getTop() give the position of the view
relative to the parent.

Is there a way to get the absolute screen position of that view?

Either a way to translate those coordinates into screen coordinates to
make a call to get the position in screen coordinates.

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: App name/icon problems on Hero after reboot

2009-11-04 Thread Rafael Sanches
I have the exact same problem with my application too.

The problem is that it seems to "erase" the app icon. I don't see the
icon anywhere else in the phone.. menu, application manager etc.

It only happened with my app so far, so it may have something to do
with the process of me debugging with the phone and then uninstalling
the app (debug different signature) and downloading again from the
market.

What do you think?

thanks
rafael

On Oct 29, 10:58 am, Dianne Hackborn  wrote:
> On Thu, Oct 29, 2009 at 10:52 AM, RichardC
> wrote:
>
> > "Where is the Android bug reporting site? "
> > b.android.com
>
> If this is only happening on Hero, it needs to be reported to HTC, not as a
> generic platform bug.
>
> Has anyone tried installing an alternate home app and seeing if it still
> happens there?  I wonder if this is something in their custom home app.
>
> --
> 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: The mysterious disappearing progress bar...

2009-11-04 Thread dadical
yup, that was it.  My activity had a background color of black, but my
application had set the theme to "lite".  I simply set the theme of
the activity to "black" (the background was black anyway) and the
progress bar reappeared.  Thanks again!

dk

On Nov 4, 11:55 am, dadical  wrote:
> Hah!  The style for my app is the "light" styled theme, so I bet that
> makes the progress bar dark.   Sheesh.  I'll check that out... thanks
> for the tip.
>
> On Nov 4, 10:19 am, Mika  wrote:
>
>
>
> > I had a similar problem and it was just because the default
> > progressbar had changed in Donut and it was all white. So I had a
> > white progressbar in a white background. Not sure if that's your
> > problem though.
>
> > -Mika
>
> > On Nov 4, 5:02 pm, dadical  wrote:
>
> > > Anyone have a clue?  I'm guessing it has something to do with changes
> > > in Donut related to buffering or optimizing display of Z-Order of
> > > views in relative layout, but maybe it's something simpler...
>
> > > I'm stacking:
>
> > > LinearLayout
> > >    RelativeLayout
> > >       VideoView  (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
> > >       ProgressBar (WRAP_CONTENT, WRAP_CONTENT, CENTER_IN_PARENT)
> > >       TextView (WRAP_CONTENT, WRAP_CONTENT, BELOW(my progress bar))
>
> > > I was counting on relative layout displaying the progress bar and the
> > > text view on top of the video view because they were added to the
> > > layout after the video view.  That worked in 1.5, but stopped since
> > > 1.6.
>
> > > On Nov 2, 11:36 pm, dadical  wrote:
>
> > > > The following code used to render an indeterminate progress bar with a
> > > > message below, all on top of a video view.  Once the video was ready,
> > > > the message and the progress bar would be made invisible.  Ever since
> > > > cupcake, the progress bar doesn't show at all.  Anyone have any clues?
>
> > > > dk
>
> > > >         private void setupView() {
> > > >                 LinearLayout lLinLayout = new LinearLayout(this);
> > > >             lLinLayout.setId(1);
> > > >             lLinLayout.setOrientation(LinearLayout.VERTICAL);
> > > >             lLinLayout.setGravity(Gravity.CENTER);
> > > >             lLinLayout.setBackgroundColor(Color.BLACK);
>
> > > >             LayoutParams lLinLayoutParms = new LayoutParams
> > > > (ViewGroup.LayoutParams.FILL_PARENT,
> > > > ViewGroup.LayoutParams.FILL_PARENT);
> > > >             lLinLayout.setLayoutParams(lLinLayoutParms);
>
> > > >             this.setContentView(lLinLayout);
>
> > > >             RelativeLayout lRelLayout = new RelativeLayout(this);
> > > >             lRelLayout.setId(2);
> > > >             lRelLayout.setGravity(Gravity.CENTER);
> > > >             lRelLayout.setBackgroundColor(Color.BLACK);
> > > >             android.widget.RelativeLayout.LayoutParams lRelLayoutParms 
> > > > = new
> > > > android.widget.RelativeLayout.LayoutParams
> > > > (ViewGroup.LayoutParams.FILL_PARENT,
> > > > ViewGroup.LayoutParams.FILL_PARENT);
> > > >             lRelLayout.setLayoutParams(lRelLayoutParms);
> > > >             lLinLayout.addView(lRelLayout);
>
> > > >             mVideoView = new VideoView(this);
> > > >             mVideoView.setId(3);
> > > >             android.widget.RelativeLayout.LayoutParams 
> > > > lVidViewLayoutParams =
> > > > new android.widget.RelativeLayout.LayoutParams
> > > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > > >             
> > > > lVidViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
> > > >             mVideoView.setLayoutParams(lVidViewLayoutParams);
> > > >             lRelLayout.addView(mVideoView);
>
> > > >             mProgressBar = new ProgressBar(this);
> > > >             mProgressBar.setId(4);
> > > >             android.widget.RelativeLayout.LayoutParams
> > > > lProgressBarLayoutParms = new
> > > > android.widget.RelativeLayout.LayoutParams
> > > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > > >             
> > > > lProgressBarLayoutParms.addRule(RelativeLayout.CENTER_IN_PARENT);
> > > >             mProgressBar.setLayoutParams(lProgressBarLayoutParms);
> > > >             lRelLayout.addView(mProgressBar);
>
> > > >             mProgressMessage = new TextView(this);
> > > >             mProgressMessage.setId(5);
> > > >             android.widget.RelativeLayout.LayoutParams
> > > > lProgressMsgLayoutParms = new
> > > > android.widget.RelativeLayout.LayoutParams
> > > > (ViewGroup.LayoutParams.WRAP_CONTENT,
> > > > ViewGroup.LayoutParams.WRAP_CONTENT);
> > > >             lProgressMsgLayoutParms.addRule
> > > > (RelativeLayout.CENTER_HORIZONTAL);
> > > >             lProgressMsgLayoutParms.addRule(RelativeLayout.BELOW, 4);
> > > >             mProgressMessage.setLayoutParams(lProgressMsgLayoutParms);
> > > >             mProgressMessage.setTextColor(Color.LTGRAY);
> > > >             mProgressMessage.setTextSize(TypedValue.COMPLEX_UNIT_PT, 8);
> > > >             mProgre

[android-developers] Re: Low level audio really needed - too much latency in SoundPool, AudioTrack for more real time stuff

2009-11-04 Thread niko20
Yes, I tested the touch event response, but that was plenty fast.

As another note, I downloaded a couple of games, and I noticed their
sound seemed to work just fine (it was in sync with the graphics), so
I'm not sure why yet, but it seems maybe only playing after touching
is slow?

Even in my other app "Tube Temp BPM", I added a click sound to play
and flash a light at the same time and it seems to be on syncso I
guess I'm not 100% sure what might be going on here.

On Friday I'll be getting a DROID so it will be interesting to see how
that responds to a pad type sound player since it's CPU is so much
faster.

-niko

On Nov 4, 1:16 pm, James  wrote:
> You're going to get lag simply from touching the screen and waiting
> for the message go to the registered handler.  So, first of all, I
> would make sure any user activity actions be bound to direct hardware
> interactions such as sensors and hardware key presses vs. UI screen
> button presses.  However you'll need to remember on an embedded device
> (and the emulator) your dalvik coded response handlers will most
> likely have a larger lag then you would expect if Dalvik was running
> on a better piece of hardware.
>
> Of course, that doesn't address the additional lag from the available
> API's from within Dalvik and playing sound.  I think ideally your
> solution there would be to write your own JNI pass through to native
> calls and then you should be able to get low level access to the sound
> library api's.  I am not sure if the native API's are documented or
> not, but it is probably the alsa api's.  Unfortunately witting the
> native code isn't trivial and you would have to cross compile binaries
> that would work with the hardware you expect your apps to work on,
> most of the embedded hardware out there is ARM.
>
> There might be a way to use the current API's to shorten the buffer
> time, but I don't know.
>
> On Oct 26, 2:17 am, niko20  wrote:
>
>
>
> > Ok I first have to say that I'm biased, 'cus I like to write music
> > apps (like music generation apps). However, this affects games as
> > well.
>
> > It's somewhat disappointing how OpenGL has made it into the NDK now
> > but there isn't any NDK methods to get to sound to have faster access.
> > Over the weekend I did some more testing and if you make a "drum" app,
> > for example, and play the sound using eitherSoundPoolor AudioTrack,
> > you will get about a 100ms delay buffer, which is clearly audible
> > (gap).
>
> > I made  a test app where when you touch the screen, upon the DOWN
> > event, it would play a short sound (like a drum sound). It clearly was
> > not real time responsive or even close - you could hear the delay.
>
> > I'd be interested to know if anyone who has made a game has any
> > trouble with sounds? It seems like they aren't going to really trigger
> > real time enough if you useSoundPool, for example. Am I completely
> > wrong? Seems like your game is going to perform an action, play a
> > sound, but the sound will have latency which I would think would throw
> > off the game a bit.
>
> > I tested to see if it perhaps was just the touch event itself that was
> > slow - I added code to change the background color of the app when you
> > touch down, and then change it back when you let up. The color changed
> > almost instantaneously. So it's not the event handling, but rather,
> > the sound objects that have the delay issues.
>
> > I found that if I used AudioTrack (I tried it in streaming mode so I
> > had more control over buffer size), it wouldn't allow me to create the
> > object unless the buffer was at least 2048 samples in size (for the
> > format I was using whic was I think 22050 mono 16 bit - this would
> > work out to almost 100ms buffer before the track begins to play), and
> > strangely I found that the amount of buffer must have been the same
> > forSoundPoolsince when loaded with the same sound, the delay was
> > similar. I also tried AudioTrack in static mode and it still had the
> > same delay asSoundPool, or using AudioTrack in stream mode too!
>
> > To get really good audio response we need to get down to the 30ms
> > delay range or so (obviously the faster the better), the iphone does
> > this with it's AudioUnit objects (of course they are in native code,
> > which you write in C).
>
> > I just hope that by the time we get to Flan, we may have NDK audio
> > access, and hopefully we can get more direct audio streams for some
> > real processing power.
>
> > Hasn't this affected games much? I would think it would still be a
> > problem in games even now, with latency so high. Even though the docs
> > saySoundPooland static AudioTrack will have lowest latency possible,
> > it still seems high to me.
>
> > -niko

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-develop

[android-developers] What’s up with ADC2 Round1 re sults?

2009-11-04 Thread Mobidev
A moonth to review the ratings? (30 days
wait is that much annoying). Are we short of computers at Google?
What’s your guess about the delay?

Is it that the Droid “drop” is holding back ADC2? We know that
Motorola is desperately trying to involve third-party applications as
part of overall experience for Motorola devices, but ADC2 is purely
Google’s commitment towards the platform & the dev community. Did they
join forces for a bigger bang tomorrow? Does spontaneous winding up of
ADC2-Round1 on 6th of Oct (exactly a month before Droid launch) hint
anything?

All day Android dev labs scheduled from Nov 9 till Nov 20 hints that
Round2 may not start until early Dec. But, lets keep this theory aside
for a day while Droid prepares for the “drop”.

http://www.youtube.com/watch?v=o9fXYQjwR0w. Any idea what's the
dropping(P&P) charges of this provider? Anyway, after watching this
I'd prefer to pick one from the store than get it delivered.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Verify musical instrument app idea: microphone, simultaneous record and play, elevation, multi-touch

2009-11-04 Thread niko20
Hi,

The multi touch is NOT limited to 3 points. Search the forums, Dianne
Hackborne indicated that she had only put in constants for up to 3,
but you can do as many as you want.

-niko

On Nov 4, 8:18 am, Ulrich Althöfer  wrote:
> Yes, those applications are the hype, I think!
> But what's about guitar-playing?
> You need 4 fingers simultaneously and more (for to hit the string)? I
> read about, that the multi-touch-option is limited to 3 simultaneously
> fingers touched.
> I am glad to see such applications!
>
> Greetings
> Ulrich
>
> On 4 Nov., 05:15, PJ  wrote:
>
>
>
> > I have a great idea for an app and wanted to get everyone's input on 4
> > different technical aspects of it.
>
> > Some of you might be familiar with the iPhone musical app where you
> > can "play" it like a flute/ocarina.  You blow into the mic and use
> > multi-touch to press a combination of holes to play different sounds.
>
> > I'm thinking about writing a *similar* app for Android, except it's a
> > *trumpet* instead of a flute.  My idea is:
> > * The screen shows three circles in a line, which represent the three
> > trumpet valves.
> > * Touching a circle represents holding down a valve.
> > * Blowing into the mic represents blowing into the trumpet.
> > * Note: On a "real" trumpet, the note pitch depends not only on the
> > valve combination, but also on the lip vibrations.  (Otherwise there
> > would only be 7-8 possible notes.)
> > * I'm thinking that the angle (elevation) of the phone could represent
> > different pitches.  So, if you elevate the phone up, you'll play a
> > higher note, for example.
>
> > The 4 technical aspects that I'd like to verify are:
>
> > 1. What is the most sensible way to detect blowing into the
> > microphone?  My current plan is to do AudioRecord.read() and manually
> > examine the audio buffer data to check for sufficiently high amplitude
> > (volume).  I think this will be pretty easy, but just wanted to check
> > whether there's another better way to do this.
>
> > 2. Is it possible to record and play at the same time?  I need to
> > record blowing into the mic and playing sound at the same time.
>
> > 3. For checking elevation angle, I assume I should use SensorManager.
> > I assume that I want to use getInclination(), but I think I might also
> > need getRotationMatrix() or getOrientation().  Seems pretty easy, but
> > does anyone know of any examples I could look at?
>
> > 4. For detecting which valves are pressed down, I assume that it's
> > feasible to use the multi-touch feature.  However, I have a G1 phone.
> > Is it possible to get multi-touch to work with the G1 phone somehow?
> > (This question probably deserves its own thread!)
>
> > I'm not going to ask about how to program multi-touch because there's
> > a good discussion of the technical features 
> > at:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > Anyway, your input is highly welcome, as well as any other suggestions
> > you might have for this app.  (By the way, I might do other
> > instruments too, besides, trumpet, but I figure that if I can get
> > trumpet to work, I can get any other instrument to work.)

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


[android-developers] Uploading your app to GetJar.com

2009-11-04 Thread gojuryu
We now have approximately 1000 Android Apps on GetJar.com with several
million downloads among them and increasing by about 10% month over
month where as our website is increasing 5.5% month over month now
serving well over 55 million downloads per month. GetJar is the worlds
largest independent open platform application distribution network,
providing free self serve developer tools and download distribution as
well as promoting optimized downloads through marketing channels.

Here are examples of how to get your apps launched and started with
GetJar.com;
http://blog.getjar.com/developer/how-to/tutorial-upload-your-app-to-getjar/

If you only have a mobile site we recommend you see this link and then
follow the directions below.
http://tinyurl.com/GetJarBuiscuitsInstructor

Before proceeding to http://my.getjar.com/profile/register/?section=developer
you will need to have:
* All of the builds for your Mobile Application [Java/J2ME, Symbian,
WinMo, Palm, Blackberry, Flashlight, Android].
* And / or your mobile site address [http://m.xxxXXXxxx.com] for us to
Auto-Build your Mobile Site Shortcut aka MSS [http://tinyurl.com/
GetJarBuiscuitsInstructor].
* And/or the download link to your iPhone product in the iTunes store
* Screenshot [Mobile Device Screenshot]. Your iPhone App, MSS and
native builds are all on the same product page! We'll do the device
recognition!
- GIF, JPG or PNG file. 320 height x 240 wide
- 20KB max file size
* Icon [to be viewed at m.getjar.com, www.getjar.com & be used as the
launch icon for MSS]
- GIF, JPG or PNG file. 64 height x 64 wide
- 7KB max file size
* Short Description [Appears on WAP and WEB sites, max. 140 chars,
HTML not allowed]
* Long Description [Appears on WEB site only]
- Max. 8000 chars
- HTML allowed
- No JavaScript in the html long description field however you can
embed a youtube video!
- No HTML descriptions wider than 630px
- No HTML descriptions higher than 812px

To further understand how GetJar.com can service [or as I prefer to
say "Make you Famous!"] please see our media kit as attached.

If your development team is in need of reference resources, have them
take a look at the following:
* http://stats.getjar.com/statistics - a reference of handset market-
share
* http://deviceatlas.com - A comprehensive database of mobile device
information multi-sourced from MobRef.com & DeviceAnywhere.com for
maximum reliability and scope.
* http://www.mobref.com - is a list of mobile devices and their user
agent profile identifiers.
* http://www.deviceanywhere.com - Primary world resource for mobile
application testing and development on LIVE handsets and devices on
most networks around the world.
* http://detectmobilebrowsers.mobi - Detect Mobile User Agents &
Browsers helping detect and better serve mobile browsers
* http://mobiforge.com - formerly known as dev.mobi and is the world's
largest independent mobile development community providing loads of
information and tools to help you develop and optimize mobile web
content.
* http://metrics.admob.com/?_metrics_confirm=1 - AdMob stores and
analyzes data from each ad request to serve the most relevant ad
possible. AdMob Mobile Metrics offers a snapshot of this data to
provide insight into trends in the mobile ecosystem.
* http://flurry.com - Flurry Analytics provides accurate, real time
data to developers about how consumers use their mobile applications,
as well as how applications are performing across different handsets.
* http://www.w3.org/TR/mobile-bp - From W3C comes "Mobile Web Best
Practices"

Let me know if you have any questions.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Documentation deficiencies.

2009-11-04 Thread jotobjects
Just another point of view - but I find the SDK documentation to be
impressive and a good job.

That said,  some methods do look like they were written by a developer
and could use some editing from an experienced tech writer.  Simple
proof reading (i.e., QA for docs) alone would go a long way.  There
are missing words and misspelled words and even places where
paragraphs end in mid sentence.  Here's a little example I ran into
just now in the package description for android.database.sqlite: "use
these classes to maange private databases" (maange is misspelled).
Yes it is a silly quibble, but there are lots of those throughout.

The art of concise and accurate API docs is something most developers
are not born with.  For instance, following on with point 7 above, in
common speech a "parcel" and a "bundle" are the same thing.  The API
docs for Parcel and Parcelable are brave descriptions but Bundle's doc
is a retreat!

That "concise" part is where I differ with some of the other comments
in this thread.  I don't think examples generally belong in the API
docs, with rare exceptions - it should be a reference and not a
tutorial.  Just my opinion.

On Nov 3, 4:09 pm, Greg Donald  wrote:
> On Tue, Nov 3, 2009 at 5:21 PM, Mark Murphy  wrote:
> > Google does not get a "30% take on all our app sales" -- that goes to
> > the carriers.
>
> Ahh.. carriers.. companies who get to charge $36 to put a row in a
> customer database.
>
> --
> Greg Donaldhttp://destiney.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: Advice Needed on Application Approach

2009-11-04 Thread Christopher
Couldn't you just ignore any onCallStateChanged() calls within the
first X seconds of the device starting up?

BOOT_COMPLETED events seem to fire before the user even has full
access to the UI, and certainly well before mobile network
connectivity has been established.  Even moreso if the user has their
SIM protected with a PIN.

Chris


On Nov 4, 4:32 pm, Tabibito  wrote:
> What I mean is that I start the service when I receive a
> "BOOT_COMPLETED" message from the system.  Immediately upon starting
> my service, onCallStateChanged() is called with a state of "idle".  No
> calls have come in, I haven't even touched the emulator... I'm
> assuming that it's happening because the call state started out as
> undefined, and when the system got around to filling it in with
> "idle", my service was already listening, and therefore got notified
> of the change (this is only a guess - I could be way off on this...).
> If I could figure out what it changed FROM, that would be useful.  I
> could also probably sense this initial anomaly with some sort of
> persistent state variable, and the first time onCallStateListener is
> called, set the variable and ignore the state change, then every
> future calling of onCallStateListener would look at that variable to
> see if it was set... but that sounds like a really messy approach for
> something that probably has a much cleaner solution.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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   >