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

[android-developers] Correct use of Task Affinities and LaunchModes

2009-09-28 Thread Gavin Bong
My android app contains a suite of mini apps. In short, every screen contains a navbar with several clickable icons, one each for the mini apps (and one for the Main screen). When an icon is clicked, the mini app is launched. In total I have 4 mini apps. So you could imagine that my main screen is

[android-developers] ViewGroup#onInterceptTouchEvent is only called once

2009-09-30 Thread Gavin Bong
In my custom ViewGroup, I am returning false after handling the MotionEvent.ACTION_DOWN event. According to the javadoc: For as long as you return false from this function, each following event (up to and including the final up) will be delivered first here and then to the target's onTouchEvent(

[android-developers] protected member variable mScrollX not accessible to subclasses of ViewGroup

2009-10-02 Thread Gavin Bong
In the android Launcher app, Workspace.java accesses the mScrollX member variable. http://www.google.com/codesearch/p?hl=fr&sa=N&cd=2&ct=rc#4r7JaNM0EqE/src/com/android/launcher/Workspace.java&q=computeScroll However it looks like mScrollX is not accessible to my ViewGroup subclass. Eclipse is m

[android-developers] Re: protected member variable mScrollX not accessible to subclasses of ViewGroup

2009-10-04 Thread Gavin Bong
Thanks. scrollTo() solved it for me. On 2 oct, 23:35, Romain Guy wrote: > mScrollX is not part of the public API. Use getScrollX() and > scrollBy()/scrollTo() to change it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[android-developers] Re: protected member variable mScrollX not accessible to subclasses of ViewGroup

2009-10-04 Thread Gavin Bong
> mScrollX is a protected member of View, so should be accessible to any > subclass. It should be but eclipse is flagging it. I presume one of Android's eclipse Builders are flagging it. Regards, G --~--~-~--~~~---~--~~ You received this message because you are

[android-developers] Architecture: one shareable Service used by many apps.

2008-06-09 Thread Gavin Bong
Hello, My goal is to create a specialized service which will download images based on a request. >From my readings, I will house this inside a ":remote" service which resides in its own apk. So I went ahead and created three separate android projects: a) client b) common c) server The Android

[android-developers] Re: Architecture: one shareable Service used by many apps.

2008-06-10 Thread Gavin Bong
OK. There was an error in my intent definition. It works now! The following question is about security. >From within a service within server.apk; I want to enforce a check such that only a list of packages can call it. I will do this via PackageManager.checkPermission( .. ); The problem with th

[android-developers] Re: Architecture: one shareable Service used by many apps.

2008-06-10 Thread Gavin Bong
Mark, > "Temporary package attribute assigning a signature to the package. This > will be removed once real support for package signing is implemented. " > > So, I wouldn't count on that specific attribute being around. Hmmm. That's the price I have to pay, playing with beta software. > same ca

[android-developers] Problem making my custom class into a Parcelable

2008-06-12 Thread Gavin Bong
Greetings, I'm getting this error when running "ant aidl". [apply] /data/projects2008/android/iteration1/lib/src/org/android/ common/IAdUnitAvailability.aidl:5 parameter 1: 'Advert ad' can be an out parameter, so you must declare it as in, out or inout. In the package, I have: a) Advert.aidl

[android-developers] Re: Problem making my custom class into a Parcelable

2008-06-12 Thread Gavin Bong
Thanks Mark. On 12 juin, 18:20, Mark Murphy <[EMAIL PROTECTED]> wrote: > This is only needed for non-primitive parameters to AIDL methods. So if > the ad parameter were a float instead of an Advert, you wouldn't have > received the error. Observe that java.lang.String parameters are not required

[android-developers] Where do you embed application version ?

2008-06-18 Thread Gavin Bong
In JavaME, the version is specified in the JAD. The documentation for AndroidManifest.xml does not describe any way to version a package. How do you handle this ? Thanks Gavin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[android-developers] Thread safety of using a Handler

2008-06-19 Thread Gavin Bong
Consider the following:- 0Handler mHandler = ... 1Foo foo = new Foo( "a" ); 2Message.obtain( mHandler, 1, foo ).sendToTarget(); Many threads will be calling line #2 using the shared Handler. Is this thread safe ? Regards, Gavin --~--~-~--~~~---~--~

[android-developers] Request for comment on Activity flow design

2008-06-24 Thread Gavin Bong
I have a need to intersperse the flow between one Activity to another with an intermediate Activity. Let's call the intermediate activity INTERMEDIATE. So imagine my application having a normal activity flow like this: A -> B -> C -> D Now putting the intermediary activity into the flow, we ge

[android-developers] SQL aggregate functions via SqlQueryBuilder

2008-06-27 Thread Gavin Bong
Hi, I want to run a query of the form: select sum(salary) from people where department=23 I'm not sure how to do it via the SqlQueryBuilder? Is there an alternative solution ? Thanks all. Regards. Gavin --~--~-~--~~~---~--~~ You received this message because y

[android-developers] Re: SQL aggregate functions via SqlQueryBuilder

2008-06-28 Thread Gavin Bong
Just discovered SQLiteDatabase.rawQuery( ... ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from th

[android-developers] Why do I get this SQLiteCursor exception ?

2008-06-28 Thread Gavin Bong
Specifically what causes this to happen ? Thanks. DEBUG/dalvikvm(927): Exception Ljava/lang/IllegalStateException; from SQLiteCursor.java:403 not caught locally INFO/dalvikvm(927): Uncaught exception thrown by finalizer (will be discarded): INFO/dalvikvm(927): Ljava/lang/IllegalStateException;:

[android-developers] Re: Why do I get this SQLiteCursor exception ?

2008-07-02 Thread Gavin Bong
Josh, Like Zach said, I was using managedQuery & managedCommitUpdates initially in the activity and the cursor was not being closed. This was on top the fact that my activity as using singleTop launch mode. I solved the SQLiteCursor exception by managing the cursor lifetime myself and I don't hav

[android-developers] Looking for a TextView with hyperlinks

2008-07-21 Thread Gavin Bong
Has anyone opensourced a TextView that will render urls as clickable links (fire up WebKit on receiving a clickc event) ? If not, I'll write one myself. Thanks Gavin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "A