[android-developers] How to send an specific key event to FG app using adb?

2010-08-13 Thread tomei.ninge...@gmail.com
Hello,

I want to keep launching my app and stress test two scenarios:

launch it and press BACK key
launch it and press MENU key

I can launch from adb using "am" command. But how can I send a BACK or
MENU key using adb.

I want to do thousands of rounds of testing so I don't want to do it
manually.

Thanks!

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


[android-developers] Re: How to dump all thread stacks?

2010-08-05 Thread tomei.ninge...@gmail.com
I ended up writing an app that sleeps forevern in an event handling
function. Whenever I need to dump stacks, I just run this app and then
adb pull /data/and/traces.txt


On Aug 4, 12:31 pm, "tomei.ninge...@gmail.com"
 wrote:
> Hello,
>
> We have a service that seem to get deadlocked very occasionally in the
> field. It's not possible to hook up to a debugger. We can detect the
> deadlock situation programmatically. Is it possible to do this from
> within Java code?
>
>       if (ohIamDeadlocked()) {
>           Thread.something.dumpStacksOfAllThreads();
>       }
>
> If this is not possible, is there an adb command that could do it?
>
> I tried "adb dumpsys" but it doesn't print any stack information.
>
> Thanks

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


[android-developers] How to dump all thread stacks?

2010-08-04 Thread tomei.ninge...@gmail.com
Hello,

We have a service that seem to get deadlocked very occasionally in the
field. It's not possible to hook up to a debugger. We can detect the
deadlock situation programmatically. Is it possible to do this from
within Java code?

  if (ohIamDeadlocked()) {
  Thread.something.dumpStacksOfAllThreads();
  }

If this is not possible, is there an adb command that could do it?

I tried "adb dumpsys" but it doesn't print any stack information.

Thanks

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


[android-developers] Re: Froyo -- How to detect that my application has been killed?

2010-08-02 Thread tomei.ninge...@gmail.com
> As far as a cache -- you shouldn't count on your process being evicted to
> clear a cache.  This has problems the other way -- there is no guarantee
> your app will be killed *ever* while in the background, since it may never
> clear its cache.  You should use other policies for this.  For example,
> after a certain amount of time (via the alarm manager maybe), etc.

I could wait a little time after going in BG, and then clear cache.
But what if the app gets killed before my timer expires?

I can't clear cache immediately on going to BG, or else the app
performance will suck.

Is there a solution to this dilemma?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Froyo -- How to detect that my application has been killed?

2010-08-02 Thread tomei.ninge...@gmail.com
Hi Dianne,

I understand that we need to handle app killed by LMK. If we can
handle LMK, we can also handle the new Froyo kill-by-task-manager
behavior.

Do you have any suggestion about this:

For example, let's say our app creates a 10MB cache file. When the app
exits, we want to delete this cache file. How to do this in the case
of killed-by-LMK?

Is there any suggestion better than "just don't use a large cache
file"?

BTW, there are a lot of code in Froyo system services that rely on
Intent.ACTION_PACKAGE_RESTARTED (such as StatusBarService). I think
these probably need to be fixed.

Thanks!


On Jul 30, 2:30 pm, Dianne Hackborn  wrote:
> It isn't being called because the app is NOT being restarted.
>
> As I said, the ONLY thing app killers can do now is the same thing that the
> OOM killer does when it needs memory, and this NEVER involved a broadcast.
>
> You have lost nothing here from previous versions of the platform.
>
> On Fri, Jul 30, 2010 at 1:27 PM, tomei.ninge...@gmail.com <
>
> tomei.ninge...@gmail.com> wrote:
> > Hi Dianne,
>
> > Our main problem is that Intent.ACTION_PACKAGE_RESTARTED is no longer
> > called in Froyo.
>
> > (Sorry I digressed to Service ... I thought that I can implement
> > something similar to Intent.ACTION_PACKAGE_RESTARTED by running a
> > service from my app. If the app is killed, the Service can detect that
> > the app is killed -- by checking the length of its callback list --
> > and then take appropriate clean up actions.)
>
> > Anyway, we used to listen to Intent.ACTION_PACKAGE_RESTARTED to do
> > clean ups. But on Froyo, when an app is killed using
> > killBackgroundProcesses, we don't get any notification.
>
> > This is a pretty big incompatible change (as I mentioned above, you
> > see left-over icons in the status bar from killed apps).
>
> > Is this an intentional change in Froyo?
>
> > Thanks
>
> > On Jul 30, 12:38 pm, Dianne Hackborn  wrote:
> > > Oh wait I take that back...  what has changed is that task killers no
> > longer
> > > go through the full force stop path -- *ALL* they can do is kill
> > processes,
> > > and further only processes that are good or moderate candidates for the
> > out
> > > of memory killer (pure background processes up to services running in the
> > > background).
>
> > > So to look at API demos -- if I use that and "Remote Service Controller"
> > to
> > > start the remote service, then use a task killer to kill API demos, what
> > > I'll see in the log is that the two processes are simply killed, just
> > like
> > > the OOM killer would do:
>
> > > I/Process (  101): Sending signal. PID: 668 SIG: 9
> > > I/Process (  101): Sending signal. PID: 641 SIG: 9
> > > W/ActivityManager(  101): Scheduling restart of crashed service
> > > com.example.android.apis/.app.RemoteService in 5000ms
> > > I/WindowManager(  101): WIN DEATH: Window{44ea7520
> > > com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> > > I/WindowManager(  101): WIN DEATH: Window{44d500f8
> > > com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> > > I/WindowManager(  101): WIN DEATH: Window{44d994d0
> > > com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> > > I/WindowManager(  101): WIN DEATH: Window{44eae490
>
> > com.example.android.apis/com.example.android.apis.app.RemoteService$Controller
> > > paused=false}
> > > D/dalvikvm(  291): GC_EXPLICIT freed 484 objects / 24352 bytes in 61ms
>
> > > And then a little later I correctly see that the remote service is
> > > restarted, just as happens if the process is killed by the OOM killer:
>
> > > I/ActivityManager(  101): Start proc com.example.android.apis:remote for
> > > service com.example.android.apis/.app.RemoteService: pid=695 uid=10062
> > > gids={3003, 1015, 1006}
>
> > > Compare that with the output of an actual force stop which the task
> > killers
> > > can no longer do:
>
> > > I/ActivityManager(  101): Force stopping package com.example.android.apis
> > > uid=10062
> > > I/Process (  101): Sending signal. PID: 695 SIG: 9
> > > I/Process (  101): Sending signal. PID: 712 SIG: 9
> > > W/ActivityManager(  101): Scheduling restart of crashed service
> > > com.example.android.apis/.app.RemoteService in 5000ms
> > > I/ActivityManager(  101):   Force finishing activity
> > HistoryRecord{44f23740
> > > com.example.android.apis/.app.RemoteService$Contr

[android-developers] Re: Froyo -- How to detect that my application has been killed?

2010-07-30 Thread tomei.ninge...@gmail.com
Hi Dianne,

Our main problem is that Intent.ACTION_PACKAGE_RESTARTED is no longer
called in Froyo.

(Sorry I digressed to Service ... I thought that I can implement
something similar to Intent.ACTION_PACKAGE_RESTARTED by running a
service from my app. If the app is killed, the Service can detect that
the app is killed -- by checking the length of its callback list --
and then take appropriate clean up actions.)

Anyway, we used to listen to Intent.ACTION_PACKAGE_RESTARTED to do
clean ups. But on Froyo, when an app is killed using
killBackgroundProcesses, we don't get any notification.

This is a pretty big incompatible change (as I mentioned above, you
see left-over icons in the status bar from killed apps).

Is this an intentional change in Froyo?

Thanks

On Jul 30, 12:38 pm, Dianne Hackborn  wrote:
> Oh wait I take that back...  what has changed is that task killers no longer
> go through the full force stop path -- *ALL* they can do is kill processes,
> and further only processes that are good or moderate candidates for the out
> of memory killer (pure background processes up to services running in the
> background).
>
> So to look at API demos -- if I use that and "Remote Service Controller" to
> start the remote service, then use a task killer to kill API demos, what
> I'll see in the log is that the two processes are simply killed, just like
> the OOM killer would do:
>
> I/Process (  101): Sending signal. PID: 668 SIG: 9
> I/Process (  101): Sending signal. PID: 641 SIG: 9
> W/ActivityManager(  101): Scheduling restart of crashed service
> com.example.android.apis/.app.RemoteService in 5000ms
> I/WindowManager(  101): WIN DEATH: Window{44ea7520
> com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> I/WindowManager(  101): WIN DEATH: Window{44d500f8
> com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> I/WindowManager(  101): WIN DEATH: Window{44d994d0
> com.example.android.apis/com.example.android.apis.ApiDemos paused=false}
> I/WindowManager(  101): WIN DEATH: Window{44eae490
> com.example.android.apis/com.example.android.apis.app.RemoteService$Controller
> paused=false}
> D/dalvikvm(  291): GC_EXPLICIT freed 484 objects / 24352 bytes in 61ms
>
> And then a little later I correctly see that the remote service is
> restarted, just as happens if the process is killed by the OOM killer:
>
> I/ActivityManager(  101): Start proc com.example.android.apis:remote for
> service com.example.android.apis/.app.RemoteService: pid=695 uid=10062
> gids={3003, 1015, 1006}
>
> Compare that with the output of an actual force stop which the task killers
> can no longer do:
>
> I/ActivityManager(  101): Force stopping package com.example.android.apis
> uid=10062
> I/Process (  101): Sending signal. PID: 695 SIG: 9
> I/Process (  101): Sending signal. PID: 712 SIG: 9
> W/ActivityManager(  101): Scheduling restart of crashed service
> com.example.android.apis/.app.RemoteService in 5000ms
> I/ActivityManager(  101):   Force finishing activity HistoryRecord{44f23740
> com.example.android.apis/.app.RemoteService$Controller}
> I/ActivityManager(  101):   Force finishing activity HistoryRecord{44d43428
> com.example.android.apis/.ApiDemos}
> I/ActivityManager(  101):   Force finishing activity HistoryRecord{44d91560
> com.example.android.apis/.ApiDemos}
> I/ActivityManager(  101):   Force finishing activity HistoryRecord{44d2e2c8
> com.example.android.apis/.ApiDemos}
> I/ActivityManager(  101):   Force stopping service ServiceRecord{44eacb00
> com.example.android.apis/.app.RemoteService}
>
> For the behavior you are seeing, are you using the bind server instead of
> the start service UI?  If you do that then yes your service will not be
> restarted -- because the process that is bound to it is in the background,
> so free to be killed, and once it gets killed the binding goes away and the
> service does not need to run any more.
>
> But this exact behavior is expected to happen when the device is low on
> memory, so it is something apps need to deal with correctly anyway.
>
> On Fri, Jul 30, 2010 at 12:20 PM, Dianne Hackborn wrote:
>
>
>
> > Um yeah the check for process priority does let it kill service processes
> > (not visible or foreground service processes though).  Whoops.  I'll fix
> > that.
>
> > That said, the service *does* restart like it always did, and I have
> > confirmed it does.  That code path hasn't changed at all.  So basically the
> > behavior is still like it was pre-2.2, except there are still some processes
> > that can unintentionally be killed.
>
> > On Fri, Jul 30, 2010 at 10:15 AM, tomei.ninge...@gmail.com <
> > tomei.ninge...@gmail.com> wrote:
>
> >&g

[android-developers] Re: Froyo -- How to detect that my application has been killed?

2010-07-30 Thread tomei.ninge...@gmail.com
Dianne, here's the reproduction step on Froyo:

[1] Run on Froyo - start ApiDemos, start the RemoveService sample. You
will now see two processes
com.example.android.apis
com.example.android.apis:remote

[2] You will notice that "Sample Remote Service" appears on status
bar.

[3] write an app with KILL_BACKGROUND_PROCESSES permission. Call

 
ActivityManager.killBackgroundProcesses("com.example.android.apis");

[4] Both processes created at step [1] are killed.

[5] RemoveService is never restarted, even though you see something
like

W/ActivityManager( 2426): Scheduling restart of crashed service
com.example.android.apis/.app.RemoteService in 2ms

[6] "Sample Remote Service" message still stays on status bar. This is
because StatusBarService expects a ACTION_PACKAGE_RESTARTED broadcast,
but
this braodcast is never delivered.

What's the best way to handle this -- we need to clean up some
resources if
the app process is killed.

Thanks!

On Jul 29, 8:15 pm, Dianne Hackborn  wrote:
> Applications can't kill services with this.  They can only kill background
> processes, which the OOM killer is free to kill at any time anyway.
>
> On Thu, Jul 29, 2010 at 6:37 PM, tomei.ninge...@gmail.com <
>
>
>
>
>
>
>
> tomei.ninge...@gmail.com> wrote:
> > On Froyo, we found that some new "Task Manager" apps are now using the
> > ActivityManager.killBackgroundProcesses() to kill apps. When this
> > happens, Intent.ACTION_PACKAGE_RESTARTED is no longer fired.
>
> > How can I find out that my application has been killed?
>
> > I tried to start a service, and I do see this message printed in
> > logcat:
>
> > W/ActivityManager( 2426): Scheduling restart of crashed service
> > com.example.android.apis/.app.RemoteService in 2ms
>
> > However, the service is never restarted as advertised, if the app is
> > killed using the killBackgroundProcesses API.
>
> > (If I go into adb shell and kill the service process, the service will
> > indeed be restarted ...)
>
> > This looks like a bug anyway, because the notification created by the
> > app is no longer removed like in eclair (the StatusBarService, and a
> > bunch of other system services, depend on the
> > Intent.ACTION_PACKAGE_RESTARTED broadcast).
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 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] Froyo -- How to detect that my application has been killed?

2010-07-29 Thread tomei.ninge...@gmail.com
On Froyo, we found that some new "Task Manager" apps are now using the
ActivityManager.killBackgroundProcesses() to kill apps. When this
happens, Intent.ACTION_PACKAGE_RESTARTED is no longer fired.

How can I find out that my application has been killed?

I tried to start a service, and I do see this message printed in
logcat:

W/ActivityManager( 2426): Scheduling restart of crashed service
com.example.android.apis/.app.RemoteService in 2ms

However, the service is never restarted as advertised, if the app is
killed using the killBackgroundProcesses API.

(If I go into adb shell and kill the service process, the service will
indeed be restarted ...)

This looks like a bug anyway, because the notification created by the
app is no longer removed like in eclair (the StatusBarService, and a
bunch of other system services, depend on the
Intent.ACTION_PACKAGE_RESTARTED broadcast).

Thanks

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


[android-developers] Re: How to tell if phone lock screen is up?

2010-05-13 Thread tomei.ninge...@gmail.com
I RTFM and found the answer:

return
((KeyguardManager)getSystemService(KEYGUARD_SERVICE)).inKeyguardRestrictedInputMode();



On May 12, 11:52 pm, "tomei.ninge...@gmail.com"
 wrote:
> I want to do something kind of disruptive to the user experience :-)
> so I want to do it only when the phone is locked. Is there a way to
> tell this?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://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] How to tell if phone lock screen is up?

2010-05-12 Thread tomei.ninge...@gmail.com
I want to do something kind of disruptive to the user experience :-)
so I want to do it only when the phone is locked. Is there a way to
tell this?

Thanks

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


[android-developers] Re: Using a permission that doesn't exist

2010-02-11 Thread tomei.ninge...@gmail.com
I found my answer:

If an app uses a permission that's not defined on your phone, it is
still displayed in Android Market. When you try to install it, the
undefined permission is NOT displayed to the user, and is NOT granted.
So later, if you later install the service that defines (and requires)
the permission, the first app will NOT be able to access the service.

The only apparent way to fix this is to reinstall the application,
which is hard to do with Android Market unless (a) a new version of
the app is posted; or (b) the user uninstalls and re-installs the app.
(b) will suck because you lose preferences and data saved by the app.



On Feb 10, 11:20 am, "tomei.ninge...@gmail.com"
 wrote:
> I saw onhttp://developer.android.com/guide/topics/security/security.html
> that my app can declare a permission:
>
> http://schemas.android.com/apk/res/android";
>     package="com.me.app.myapp" >
>
>      android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY"
>         android:label="@string/permlab_deadlyActivity"
>         android:description="@string/permdesc_deadlyActivity"
>         android:permissionGroup="android.permission-group.COST_MONEY"
>         android:protectionLevel="dangerous" />
> 
>
> So if another app "Foo" need to invoke the deadly activity, it would
> declare the following in its Manifest:
>
>  android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY" />
>
> However, what if com.me.app.myapp is not yet installed on the device?
>
> [a] I tested with "adb install", and Foo was installed on the device
> without incident. The only thing I see is "W/PackageManager(   62):
> Unknown permission com.me.app.myapp.permission.DEADLY_ACTIVITY in
> package com.foo.Foo"
>
> [b] if I upload Foo into Android Market, but the user has not yet
> installed "myapp", will he be able to see Foo in market?
>
> [c] if the answer to [b] is yes (I really hope so, or else it will be
> a major bummer ...) what message will the user see regarding
> com.me.app.myapp.permission.DEADLY_ACTIVITY? Since the description of
> this permission is declared only in "myapp", without "myapp"
> installed, will the user just see the name of the permission, which
> probably doesn't mean much?
>
> If [c] is true, would this be a weakness to the Android permission
> system/Android Market? As long as I can fool the user to install my
> app first, I would be able to gain permissions that the user would not
> have otherwise granted me (had he known the true nature of such
> permissions).
>
> Thanks!

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


[android-developers] Using a permission that doesn't exist

2010-02-10 Thread tomei.ninge...@gmail.com
I saw on http://developer.android.com/guide/topics/security/security.html
that my app can declare a permission:

http://schemas.android.com/apk/res/android";
package="com.me.app.myapp" >




So if another app "Foo" need to invoke the deadly activity, it would
declare the following in its Manifest:



However, what if com.me.app.myapp is not yet installed on the device?

[a] I tested with "adb install", and Foo was installed on the device
without incident. The only thing I see is "W/PackageManager(   62):
Unknown permission com.me.app.myapp.permission.DEADLY_ACTIVITY in
package com.foo.Foo"

[b] if I upload Foo into Android Market, but the user has not yet
installed "myapp", will he be able to see Foo in market?

[c] if the answer to [b] is yes (I really hope so, or else it will be
a major bummer ...) what message will the user see regarding
com.me.app.myapp.permission.DEADLY_ACTIVITY? Since the description of
this permission is declared only in "myapp", without "myapp"
installed, will the user just see the name of the permission, which
probably doesn't mean much?

If [c] is true, would this be a weakness to the Android permission
system/Android Market? As long as I can fool the user to install my
app first, I would be able to gain permissions that the user would not
have otherwise granted me (had he known the true nature of such
permissions).

Thanks!

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


[android-developers] Re: How to achieve ultra smooth OpenGL/ES animation

2010-02-01 Thread tomei.ninge...@gmail.com
I am already doing the animation in a time-based fashion. However,
when I scroll the texture at a constant speed across the screen, I can
see stuttering when the frame rate changes between 60fps and 30fps.
Apparently the human eye is very good at detecting this kind of
anomaly.

On Feb 1, 4:35 pm, Robert Green  wrote:
> What MrChaz said.  Use time-based animation and then if you want to
> smooth out the rough spots, you can tick using a running average.
>
> On Feb 1, 1:02 pm, MrChaz  wrote:
>
>
>
> > The easiest way to achieve a smooth rotation is to multiply the
> > rotation amount by the time difference between the current frame and
> > the last frame - that way the amount moved is constant over time.
>
> > On Feb 1, 5:18 pm, "tomei.ninge...@gmail.com"
>
> >  wrote:
> > > Hello Android OpenGL/real-time gurus,
>
> > > I am drawing a pretty simple scene, with one large texture the about
> > > size of the screen (two triangles). I notice that the frame-rate is
> > > irregular: in most of cases, a frame finishes in 17 ms. However, in
> > > about 1 of 10 times, the frame finishes in 33ms.
>
> > > My guess is probably some background services need to run. However,
> > > the Linux scheduler is biased towards my FG app, so the BG services
> > > are usually starved, until they can't take it anymore and they grab
> > > the CPU from my app 
>
> > > I am seeing stuttering in the animation. Is this due to the irregular
> > > frame rate? Should I delay each frame so that all frames are rendered
> > > with 33ms frame time? If so, what's the best technique of achieving
> > > this?
>
> > > Is there an API that I can call to guarantee CPU resources for the
> > > render thread  I really hope Android runs on some sort of real
> > > time kernel ...
>
> > > Thanks!

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


[android-developers] Re: How to achieve ultra smooth OpenGL/ES animation

2010-02-01 Thread tomei.ninge...@gmail.com
Thanks for the suggestion. I forced GC before starting the animation
and I can verify that no GC log comes in logcat, but still I am seeing
stuttering in the animation.

On Feb 1, 10:24 am, fulanito  wrote:
> > I am drawing a pretty simple scene, with one large texture the about
> > size of the screen (two triangles). I notice that the frame-rate is
> > irregular: in most of cases, a frame finishes in 17 ms. However, in
> > about 1 of 10 times, the frame finishes in 33ms.
>
> This could be the garbage collector.
> Whenever the garbage collector is called, you can see a message in the
> logcat, under the tag "dalvikvm", using log level debug.
> If it is the GC, the way to fix it is to avoid allocating memory:
> every time you allocate memory,
> the GC wakes up to check if there is something to collect; just pre-
> allocate all the objects you need,
> and that´s it.
> You can also call the GC manually, when the timing is good for you,
> using the System.gc() call.
>
> Fulanito.

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

2010-02-01 Thread tomei.ninge...@gmail.com
Hello Android OpenGL/real-time gurus,

I am drawing a pretty simple scene, with one large texture the about
size of the screen (two triangles). I notice that the frame-rate is
irregular: in most of cases, a frame finishes in 17 ms. However, in
about 1 of 10 times, the frame finishes in 33ms.

My guess is probably some background services need to run. However,
the Linux scheduler is biased towards my FG app, so the BG services
are usually starved, until they can't take it anymore and they grab
the CPU from my app 

I am seeing stuttering in the animation. Is this due to the irregular
frame rate? Should I delay each frame so that all frames are rendered
with 33ms frame time? If so, what's the best technique of achieving
this?

Is there an API that I can call to guarantee CPU resources for the
render thread  I really hope Android runs on some sort of real
time kernel ...

Thanks!

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


[android-developers] Re: Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-12-01 Thread tomei.ninge...@gmail.com
After I rebuilt my app a few times w/o change the AndroidManifest.xml,
my user told me now he can see it on the Android market. This seems a
bit strange, but I am happier now.

SoftwareForMe.com wrote:
"I guess Google expects others to fill the void and build business
around the services we all need. For
example, online market listings: there are now many."

How can anyone build such a business when the market data is not
available (without hacking, etc)? I have used many of the online
market listings. None of them allow me to contact the user. Only one
allows viewing multi-language comments, but that's very clumsy to use.

I am frustrated because Google has all the data. If it decides just to
lift its little finger for a few engineer-days, the data can be
exported to Developer Console. And Google has not done anything for
more than a year. And that's because it thinks developers like us a
shiite.


On Dec 1, 11:22 am, "SoftwareForMe.com SoftwareForMe.com"
 wrote:
> @Nemat,
>
> Would you mind telling me if you can see PhoneMyPC in the Market on your
> Tattoo?
>
> @tomei,
> I too would like some of those services. I guess Google expects others to
> fill the void and build business around the services we all need. For
> example, online market listings: there are now many.
>
> I hope you're wrong about HTML5/Chrome; I'd like to see the idea of on-board
> apps continue. There are many things you can do with an app that won't be
> possible in HTML5 for many years to come.
>
> SoftwareForMe.com
> Makers of PhoneMyPC
>
> On Mon, Nov 30, 2009 at 10:21 PM, tomei.ninge...@gmail.com <
>
> tomei.ninge...@gmail.com> wrote:
> > No, it's not protected.
>
> > On Nov 30, 10:12 pm, westmeadboy  wrote:
> > > Is your app copy-protected?
>
> > > On Dec 1, 1:48 pm, "tomei.ninge...@gmail.com"
>
> > >  wrote:
> > > > Hi SoftwareForMe.com,
>
> > > > Sorry for my ranting. I was/am really frustrated by Google's lack of
> > > > developer support, especially related to the Market.
>
> > > > I really would like to have features like these:
>
> > > > (a) When I upload my app, it would be nice for them to give me a
> > > > warning -- your app will not show up on these devices because of
> > > > reason XXX.
>
> > > > (b) contact a user to address bad comments he posted about my app
>
> > > > (c) see comments from users, in all languages, in real time via the
> > > > web
>
> > > > (d) see ranking, per-country statistics, etc
>
> > > > The Market has been operating for more than a year. I can't believe a
> > > > company who claims to be a web company can't even do such basic stuff.
>
> > > > My only conclusion is -- Google doesn't want Android apps to be "too
> > > > successful". They want everyone to use HTML5, web, etc, so that they
> > > > can sell more ads. That's the direction they want to go with Chrome
> > > > OS. So for developers like me who write a local, non-ad-based app, I
> > > > can go screw myself.
>
> > > > On Nov 30, 9:06 pm, "SoftwareForMe.com SoftwareForMe.com"
>
> > > >  wrote:
> > > > > Being a real lover of the Android platform, I'm a little frustrated
> > that
> > > > > things aren't perfect, that there are some devices that can't [yet]
> > see some
> > > > > apps, and that there are splinter devices (Archos) that won't have
> > access to
> > > > > the de-facto Android App market.
>
> > > > > Nonetheless, Google's market is amongst the top selling points for
> > all
> > > > > Android phones, is a key point of comparison when pitting Android is
> > pitted
> > > > > against Apple, WimMo, etc., and as such, will succeed and continue to
> > grow,
> > > > > in my opinion.
>
> > > > > I would very much like to chase phone models and make sure they can
> > all see
> > > > > our apps--we want sales as much as the next team--but I really
> > believe this
> > > > > thinking is backwards. OEMs should be the ones working to make sure
> > their
> > > > > phones have access to the widest array of apps possible.
>
> > > > > As long as we developers follow the standards, practice good
> > development
> > > > > practices and do the 'right thing' to make our apps run on all
> > phones, the
> > > > > continued problem of '

[android-developers] Re: Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-11-30 Thread tomei.ninge...@gmail.com
No, it's not protected.

On Nov 30, 10:12 pm, westmeadboy  wrote:
> Is your app copy-protected?
>
> On Dec 1, 1:48 pm, "tomei.ninge...@gmail.com"
>
>
>
>  wrote:
> > Hi SoftwareForMe.com,
>
> > Sorry for my ranting. I was/am really frustrated by Google's lack of
> > developer support, especially related to the Market.
>
> > I really would like to have features like these:
>
> > (a) When I upload my app, it would be nice for them to give me a
> > warning -- your app will not show up on these devices because of
> > reason XXX.
>
> > (b) contact a user to address bad comments he posted about my app
>
> > (c) see comments from users, in all languages, in real time via the
> > web
>
> > (d) see ranking, per-country statistics, etc
>
> > The Market has been operating for more than a year. I can't believe a
> > company who claims to be a web company can't even do such basic stuff.
>
> > My only conclusion is -- Google doesn't want Android apps to be "too
> > successful". They want everyone to use HTML5, web, etc, so that they
> > can sell more ads. That's the direction they want to go with Chrome
> > OS. So for developers like me who write a local, non-ad-based app, I
> > can go screw myself.
>
> > On Nov 30, 9:06 pm, "SoftwareForMe.com SoftwareForMe.com"
>
> >  wrote:
> > > Being a real lover of the Android platform, I'm a little frustrated that
> > > things aren't perfect, that there are some devices that can't [yet] see 
> > > some
> > > apps, and that there are splinter devices (Archos) that won't have access 
> > > to
> > > the de-facto Android App market.
>
> > > Nonetheless, Google's market is amongst the top selling points for all
> > > Android phones, is a key point of comparison when pitting Android is 
> > > pitted
> > > against Apple, WimMo, etc., and as such, will succeed and continue to 
> > > grow,
> > > in my opinion.
>
> > > I would very much like to chase phone models and make sure they can all 
> > > see
> > > our apps--we want sales as much as the next team--but I really believe 
> > > this
> > > thinking is backwards. OEMs should be the ones working to make sure their
> > > phones have access to the widest array of apps possible.
>
> > > As long as we developers follow the standards, practice good development
> > > practices and do the 'right thing' to make our apps run on all phones, the
> > > continued problem of 'disenfranchised phones' will attract attention, and
> > > it's the OEMs who will pay (HTC, being that they are so far the kings of
> > > "can't do that").
>
> > > SoftwareForMe.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: Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-11-30 Thread tomei.ninge...@gmail.com
Hi SoftwareForMe.com,

Sorry for my ranting. I was/am really frustrated by Google's lack of
developer support, especially related to the Market.

I really would like to have features like these:

(a) When I upload my app, it would be nice for them to give me a
warning -- your app will not show up on these devices because of
reason XXX.

(b) contact a user to address bad comments he posted about my app

(c) see comments from users, in all languages, in real time via the
web

(d) see ranking, per-country statistics, etc

The Market has been operating for more than a year. I can't believe a
company who claims to be a web company can't even do such basic stuff.

My only conclusion is -- Google doesn't want Android apps to be "too
successful". They want everyone to use HTML5, web, etc, so that they
can sell more ads. That's the direction they want to go with Chrome
OS. So for developers like me who write a local, non-ad-based app, I
can go screw myself.


On Nov 30, 9:06 pm, "SoftwareForMe.com SoftwareForMe.com"
 wrote:
> Being a real lover of the Android platform, I'm a little frustrated that
> things aren't perfect, that there are some devices that can't [yet] see some
> apps, and that there are splinter devices (Archos) that won't have access to
> the de-facto Android App market.
>
> Nonetheless, Google's market is amongst the top selling points for all
> Android phones, is a key point of comparison when pitting Android is pitted
> against Apple, WimMo, etc., and as such, will succeed and continue to grow,
> in my opinion.
>
> I would very much like to chase phone models and make sure they can all see
> our apps--we want sales as much as the next team--but I really believe this
> thinking is backwards. OEMs should be the ones working to make sure their
> phones have access to the widest array of apps possible.
>
> As long as we developers follow the standards, practice good development
> practices and do the 'right thing' to make our apps run on all phones, the
> continued problem of 'disenfranchised phones' will attract attention, and
> it's the OEMs who will pay (HTC, being that they are so far the kings of
> "can't do that").
>
> SoftwareForMe.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: Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-11-30 Thread tomei.ninge...@gmail.com
Hi Nemat,

Thanks a lot for your help!

I have an app that shows up on other Android phones but don't show up
on Android Market in Tattoo. I tried following the Google
documentation as well as HTCs

 
http://android-developers.blogspot.com/2009/10/support-for-additional-screen.html
 http://developer.htc.com/htc_tattoo_developer.html

I already have







but still my users report that they can't see my app. It's very
frustrating for me because I don't have a Tattoo phone.

If you have time, could you tell me the names of a few apps that show
up on your Tattoo phone? I will download them on my own G1 phone and
examine their AndroidManifest file, to see what their "success story"
is. I didn't want to go down this path, but I really can't afford to
buy every phone out there to test compatibility.

Thanks!

On Nov 30, 9:01 pm, Nemat  wrote:
> Hi,
>
> I have tattoo.But I dont understand your problem.How can I help
> you
>
> Regards
> Nemat
>
> On Dec 1, 9:55 am, Dan Sherman  wrote:
>
>
>
> > Never bored, always working on new apps :)
>
> > On Mon, Nov 30, 2009 at 11:36 PM, tomei.ninge...@gmail.com <
>
> > tomei.ninge...@gmail.com> wrote:
> > > Why is this group full of people who want to make a statement about
> > > everything when they don't have anything to contribute? Are you really
> > > bored? Go get a life!
>
> > > On Nov 30, 8:10 pm, Dan Sherman  wrote:
> > > > But if you're switching your development efforts, why would you need the
> > > > names of apps?
>
> > > > Also, blatently stating that you're planning to pirate apps might not be
> > > the
> > > > best of ways to get help...
>
> > > > On Mon, Nov 30, 2009 at 11:06 PM, tomei.ninge...@gmail.com <
>
> > > > tomei.ninge...@gmail.com> wrote:
> > > > > My app is now showing up on HTC tattoo. Many people have complained
> > > > > about this and I don't see ANY response from Google.
>
> > > > > Google, you are PATHETIC!
>
> > > > > Could anyone who has a Tattoo post the name of ONE (or preferably a
> > > > > few :-)  apps that can show up on HTC Tattoo? I will pirate them and
> > > > > copy their AndroidManifest file.
>
> > > > > My app uses only these 3 permissions:
>
> > > > >     > > > > permission>
> > > > >     > > > > android:name="android.permission.WRITE_EXTERNAL_STORAGE"> > > > > permission>
> > > > >     > > > > android:name="android.permission.ACCESS_NETWORK_STATE"> > > > > permission>
>
> > > > > And I say it again, Google, you are PATHETIC! Thank you for you non-
> > > > > existence development support! I will switch my app to dead OSes like
> > > > > Windows Mobile and Symbian, instead of wasting my time on a pile of
> > > > > crap like yours!
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > android-developers@googlegroups.com
> > > > > To unsubscribe from this group, 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-Hide quoted text -
>
> > - Show quoted text -

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


[android-developers] Re: Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-11-30 Thread tomei.ninge...@gmail.com
Why is this group full of people who want to make a statement about
everything when they don't have anything to contribute? Are you really
bored? Go get a life!

On Nov 30, 8:10 pm, Dan Sherman  wrote:
> But if you're switching your development efforts, why would you need the
> names of apps?
>
> Also, blatently stating that you're planning to pirate apps might not be the
> best of ways to get help...
>
> On Mon, Nov 30, 2009 at 11:06 PM, tomei.ninge...@gmail.com <
>
>
>
> tomei.ninge...@gmail.com> wrote:
> > My app is now showing up on HTC tattoo. Many people have complained
> > about this and I don't see ANY response from Google.
>
> > Google, you are PATHETIC!
>
> > Could anyone who has a Tattoo post the name of ONE (or preferably a
> > few :-)  apps that can show up on HTC Tattoo? I will pirate them and
> > copy their AndroidManifest file.
>
> > My app uses only these 3 permissions:
>
> >     > permission>
> >     > android:name="android.permission.WRITE_EXTERNAL_STORAGE"> > permission>
> >     > android:name="android.permission.ACCESS_NETWORK_STATE"> > permission>
>
> > And I say it again, Google, you are PATHETIC! Thank you for you non-
> > existence development support! I will switch my app to dead OSes like
> > Windows Mobile and Symbian, instead of wasting my time on a pile of
> > crap like yours!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, 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] Can anyone tell me ONE app that shows up in Android Market on HTC Tattoo

2009-11-30 Thread tomei.ninge...@gmail.com
My app is now showing up on HTC tattoo. Many people have complained
about this and I don't see ANY response from Google.

Google, you are PATHETIC!

Could anyone who has a Tattoo post the name of ONE (or preferably a
few :-)  apps that can show up on HTC Tattoo? I will pirate them and
copy their AndroidManifest file.

My app uses only these 3 permissions:





And I say it again, Google, you are PATHETIC! Thank you for you non-
existence development support! I will switch my app to dead OSes like
Windows Mobile and Symbian, instead of wasting my time on a pile of
crap like yours!

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


[android-developers] DROID so buggy (OpenGL) -- and work around

2009-11-26 Thread tomei.ninge...@gmail.com
I found that on DROID OpenGL implementation acts very differently than
all other 1.5 and 1.6 phones.

Bug (1): I have a SurfaceView that has getVisibility() ==
VIEW.VISIBLE, but is completely hidden by another view. When I am in
portrait mode, and pull open the keyboard, the screen orientation does
not change. In fact, the UI is frozen and does not accept any key or
touch input. The only way to get out is to use the HOME hardware
button to go back to home screen, and then return to the app, at which
time the orientation is finally changed and UI takes input again.

The work around is this:

public void onConfigurationChanged(Configuration newConfig) {
mSurfaceView.setVisibility(View.INVISIBLE);
super.onConfigurationChanged(newConfig);
}

Bug (2): the workaround in (1) causes this problem -- when SurfaceView
that has getVisibility() == VIEW.INVISIBLE, and user presses HOME
button to pause the app, and then launches the app again, the
SurfaceView becomes black (even if I get a supposed callback that
tells me that surface is created, at which point I reloaded all of my
textures). The work around is here -- in conjunction with the above

protected void onPause() {
super.onPause();
mSurfaceView.onPause();
mSurfaceView.setVisibility(View.VISIBLE);
}

protected void onResume() {
super.onResume();
mSurfaceView.setVisibility(View.VISIBLE);
mSurfaceView.onResume();
}

So far these hacks seem to work fine on 1.5, 1.6 and DROID, but I am
really worried that as Android advances and fragments, eventually my
OpenGL app will get crushed by the rate of change and apparent lack of
testing by Google.

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


[android-developers] Android Market Protocol

2009-11-25 Thread tomei.ninge...@gmail.com
Hello,

Has anyone fully decoded the market's protocol? I want to do something
simple and harmless -- easily find out comments for my apps in all
languages.

I found some info in http://strazzere.com/blog/?p=293 but that doesn't
seem to be complete. I.e., no generic way to find out a tokenId from
your gmail login.

Thanks

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


[android-developers] Re: Possible to change between "full screen" and "with status bar"?

2009-11-23 Thread tomei.ninge...@gmail.com
This works for me:

// go full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes
();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
mActivity.getWindow().setAttributes(attrs);

// go non-full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes
();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
mActivity.getWindow().setAttributes(attrs);

On Nov 19, 7:25 pm, freeman  wrote:
> Can you toggle between the full screen mode and normal mode? I got an
> exception when I call WindowManager.addFlags/setFlags affter the
> activity has been created. The exception told me something like "You
> cannot modify the flags once the activity is created".
>
> On Nov 12, 5:01 pm, "tomei.ninge...@gmail.com"
>
>
>
>  wrote:
> > Thanks Dianne. This works like a charm. The title bar even animates
> > the hide/show action!
>
> > On Nov 10, 11:32 pm, Dianne Hackborn  wrote:
>
> > > Change the window flag -- getWindow() to get the window, and change the
> > > fullscreen flag defined in WindowManager.LayoutParams.
>
> > > On Tue, Nov 10, 2009 at 9:48 PM, tomei.ninge...@gmail.com <
>
> > > tomei.ninge...@gmail.com> wrote:
> > > > Hi,
>
> > > > Is it possible to show/hide the status bar without creating a new
> > > > "full screen" activity?
>
> > > > I want to creating something like Firefox browser, where user can
> > > > toggle the "full screen" mode.
>
> > > > Thanks
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see 
> > > and
> > > answer them.

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


[android-developers] Re: screen compatibility not quite right

2009-11-22 Thread tomei.ninge...@gmail.com
I have to say that Android's screen compatibility worked out really
well for me. My app specifies all positions using DIPs, and it worked
on the DROID without any change (or even recompilation -- the app was
built using SDK 1.1).

Essentially all screen coordinates were scaled by 1.5, and bitmaps
were also scaled by 1.5, in BOTH directions.

The only problem I still have is with WebView + JavaScript. The
coordinates returned by obj.offsetTop, etc, in JavaScript are "shrunk
by 1.5x" when running on DROID, even if I specified the following in
AndroidManifest.xml:



That wasn't too hard to work around, but I wonder if there's a
"disable compability mode" switch in WebView 


On Nov 22, 12:16 am, Dianne Hackborn  wrote:
> On Sat, Nov 21, 2009 at 4:26 PM, Mark Murphy wrote:
>
>
>
>
>
> > "DROID has been optimized to display wide-screen multimedia (movie)
> > content at its native aspect ratio of 16/9. This is different from the
> > HVGA aspect ratio of 3/2, which is the traditional computer screen
> > format. What this means is that when content is scaled up to "full
> > screen", the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
> > are different. As a result, when displaying the same bitmap as a full
> > screen background, round circles can appear as ovals, and squares are
> > elongated to rectangles."
>
> >http://developer.motorola.com/docstools/library/Support_for_Multiple_...
>
> > I have no reason to believe this is DROID-specific, but rather is how
> > Android scales things in WVGA800/WVGA854, when you do not supply your
> > own pre-scaled resources.
>
> I think what they are trying to say is correct, but probably misleading.
>
> First, scaling is only done based on density, and does NOT change aspect
> ratio.  If you are on a high density device, and your assets are medium
> density, they will be scaled by 1.5 in both width and height, period, end of
> story.
>
> What this Motorola doc is describing is what I would consider a special
> case.  If you make a layout that is fill parent for both width and height,
> then on a WVGA of course it will be taller than on HVGA because the screen
> you are filling is taller.  Now if you set a drawable as its background, the
> View class draws its background by simply stretching the drawable to fill
> its contents, so your bitmap will be stretched to fill whatever aspect ratio
> your layout has ended up being.  This is just a matter of accounting for the
> screen being different sizes and designing your layout to adjust
> accordingly.
>
> > You cannot control the aspect ratio, as that is dictated by the physical
> > parameters of the screen. AFAIK, there is no Android equivalent of
> > "letterbox" that would put black bars on either side of your app and
> > give you a smaller virtual screen with 3/2 aspect ratio.
>
> We actually do a "postage stamp" for apps on large screens, since we found
> that a significant number of them broke when given so much extra space.
>  However, the vast majority of existing apps work reasonably well when
> presented with a WVGA screen, so rather than cause all of the existing ones
> to not be able to use that space, we decided to not provide compatibility
> for that and live with the small handful that did have significant problems.
>
> But for someone writing an app today, this is fairly irrelevant, because if
> your app really can't use anything more than an HVGA screen then you really
> just need to design your layout to center or whatever you want your content
> in whatever screen you are running on.
>
> > Also in my layout I am positioning some items using pixel positions.
> > > Should I convert these to dpi?
> > If you mean dip (density-independent pixels), perhaps. It depends on
> > what the pixels represent. There is no hard-and-fast rule.
>
> But the vast majority of time, yes, you do want to use dpis.
>
> However!  The original post showed that the app was actually saying it can't
> deal with densities.  This means the system will emulate a medium density
> screen on whatever density the device  is, so 1 px == 1 dip.  However, you
> really should not be saying that you don't support densities -- there are
> artifacts that can happen when doing this, such as font metrics not being
> quite right.
>
> If you are writing an app today, you really want to not put yourself in
> compatibility mode, and just write the app correctly.
>
> --
> 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
F

[android-developers] Bug in GLSurfaceView.RENDERMODE_WHEN_DIRTY (and work-around)

2009-11-21 Thread tomei.ninge...@gmail.com
My OpenGL app animates only every now and then, so I decided to use
RENDERMODE_WHEN_DIRTY to save some battery life. However, I found that
when I go to Home Screen and return to my app, I often get a black
screen, and I see this in logcat:

E/SurfaceComposerClient( 6055): using an invalid surface id=1,
identity=735 should be 738

This seems to be caused by this code in GLSurfaceView (1.6 here, but
2.0 has same problem):


synchronized (this) {

if (mPaused) {
mEglHelper.finish();
needStart = true;
}
while (needToWait()) {
wait();
}
...
}
if (needStart) {
mEglHelper.start();
..

If I use RENDERMODE_WHEN_DIRTY, I will be stuck inside the wait()
call. When my app is paused/resumed,  GLSurfaceView.{onPause,onResume}
will be called, by the change in mPaused will be lost. So when wait()
finally finishes, the mEglHelper.finish() and mEglHelper.start() lines
are not executed, and I end up drawing into the wrong surface.

The work around is simple but a bit ugly:

public MyView() {
super();
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}

public void onResume() {
super.onResume();
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
requestRender();
}

public void onPause() {
setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
android.os.SystemClock.sleep(60);
super.onPause();
}

The trick is to temporarily get the GLSurfaceView to run in
RENDERMODE_CONTINUOUSLY. I found the sleep(60) to be necessary to
avoid race conditions that somehow left me hanging inside the wait()
 but I am not sure if this is 100% scientific.

Anyway, cheers, and save a few battery bars!

P.S., I found this to be somewhat disconcerting ... as the longevity
of this bug shows not too many people are trying to use OpenGL to make
their UI faster -- and battery efficient. This probably means that
iPhone apps will continue to look-and-feel better than Android for
quite some time :-(


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

2009-11-19 Thread tomei.ninge...@gmail.com
I tried and it worked. You are right that if you use the SDK straight
you won't be able to compile such code. However, if you replace the
API jar file from the SDK, then you can build such apps with calls to
hidden APIs.

So it seems Android doesn't really try to prevent you from using
hidden APIs (not that this is recommended for production apps) so as
long as you could build the APK file you're good to go -- at least for
the specific version of Android on the specific handset that you're
targeting. For me that's good enough as I was just writing a demo.

On Nov 19, 5:54 am, "Fred Grott(Android Expert, 
http://mobilebytes.wordpress.com)"
 wrote:
> Try it you  will not get a compile though..the are not in the
> framework jar so it would be a pointless task on your part..
>
> Fred Grott
> Android Developerhttp://mobilebytes.wordpress.com
>
> On Nov 18, 7:49 pm, "tomei.ninge...@gmail.com"
>
>
>
>  wrote:
> > There are a bunch of APIs that are hidden using the @hide tag so they
> > are not exposed in the SDK. If I call these APIs anyway, does the VM
> > actually prevent me from doing that (in dexopt stage, etc)?
>
> > I am trying to do a demo so I just need a quick hack. This is not for
> > a product so please don't tell me to "do the right thing" :-)
>
> > Thanks

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


[android-developers] hidden APIs in Android

2009-11-18 Thread tomei.ninge...@gmail.com
There are a bunch of APIs that are hidden using the @hide tag so they
are not exposed in the SDK. If I call these APIs anyway, does the VM
actually prevent me from doing that (in dexopt stage, etc)?

I am trying to do a demo so I just need a quick hack. This is not for
a product so please don't tell me to "do the right thing" :-)

Thanks

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


[android-developers] How much texture memory can I expect?

2009-11-15 Thread tomei.ninge...@gmail.com
Is it possible to allocate at least 1024x1024 pixels of textures? This
seems to be the case on the G1 (I have a very small number of vertices
and a few very big textures). Is it safe to assume that all Android
phones can support at least this much of texture?

Thanks

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


[android-developers] How to force hw.lcd.density for a specific app

2009-11-15 Thread tomei.ninge...@gmail.com
Hello,

Is it possible to force Android to use a given LCD density value? For
example, if the app is running on a WVGA phone that reports LCD
density of 160DPI *and* screen size of 3.7inch, one of those two
values must be wrong. Is it possible to tell Android to ignore the
160DPI value and use 240DPI instead (for my Activity only)?

Thanks

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


[android-developers] How many 1.1 devices are still out there?

2009-11-15 Thread tomei.ninge...@gmail.com
Are there any developers who switched from 1.1 to 1.5 APIs recently?
Have you heard any complaints from users that are still using a 1.1
device?

Thanks

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


[android-developers] Re: Possible to change between "full screen" and "with status bar"?

2009-11-12 Thread tomei.ninge...@gmail.com
Thanks Dianne. This works like a charm. The title bar even animates
the hide/show action!

On Nov 10, 11:32 pm, Dianne Hackborn  wrote:
> Change the window flag -- getWindow() to get the window, and change the
> fullscreen flag defined in WindowManager.LayoutParams.
>
> On Tue, Nov 10, 2009 at 9:48 PM, tomei.ninge...@gmail.com <
>
>
>
>
>
> tomei.ninge...@gmail.com> wrote:
> > Hi,
>
> > Is it possible to show/hide the status bar without creating a new
> > "full screen" activity?
>
> > I want to creating something like Firefox browser, where user can
> > toggle the "full screen" mode.
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 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] Possible to change between "full screen" and "with status bar"?

2009-11-10 Thread tomei.ninge...@gmail.com
Hi,

Is it possible to show/hide the status bar without creating a new
"full screen" activity?

I want to creating something like Firefox browser, where user can
toggle the "full screen" mode.

Thanks

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


[android-developers] TranslucentGLSurfaceViewActivity and screen rotation

2009-11-09 Thread tomei.ninge...@gmail.com
On my G1 that runs Android 1.6, I enabled screen rotation in the
Settings app. Then, I run the ApiDemos, start the
TranslucentGLSurfaceViewActivity, and rotating the phone. After a few
trials, the TranslucentGLSurfaceViewActivity stops refreshing. I see a
lot of this in adb logcat:

E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context
E/libEGL  (13033): call to OpenGL ES API with no current context

Is this a known issue? I am trying to decide whether to use
TranslucentGLSurfaceViewActivity in my app. If it's flaky then I'd
better not use it ...

Thanks

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


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

2009-11-03 Thread tomei.ninge...@gmail.com
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


[android-developers] How to pass large amount of data during startActivityForResult

2009-11-03 Thread tomei.ninge...@gmail.com
>From one activity, I want to pass a lot of data (about 1MB of
Strings).

I tried sticking it in Intent.putExtra(ArrayList), but if I
put in too much data, I get "FAILED BINDER TRANSACTION".

What's the easiest way? I don't want to publish a service, or use the
file system. I really want a pipe that can write data from one end and
read it from the other end.

I can handle the case where the starter Activity dies while the
"startee" activity is trying to read from the pipe.

Thanks

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


[android-developers] Re: How to pass large amount of data during startActivityForResult

2009-11-03 Thread tomei.ninge...@gmail.com
Does anyone have a real answer?

I need to do this. If you don't know how to do it please don't feel
obliged to reply to tell me it's not an androidie thing to do.

On Nov 3, 3:32 pm, Mark Murphy  wrote:
> tomei.ninge...@gmail.com wrote:
> > From one activity, I want to pass a lot of data (about 1MB of
> > Strings).
>
> No, you don't. You want 1MB of data to be available to multiple
> activities. There is a very big difference; you do NOT want to be
> copying 1MB of Strings.
>
> > I tried sticking it in Intent.putExtra(ArrayList), but if I
> > put in too much data, I get "FAILED BINDER TRANSACTION".
>
> And, among other things, this would be copying 1MB of Strings once or twice.
>
> > What's the easiest way? I don't want to publish a service, or use the
> > file system. I really want a pipe that can write data from one end and
> > read it from the other end.
>
> > I can handle the case where the starter Activity dies while the
> > "startee" activity is trying to read from the pipe.
>
> Use a static data member.
>
> --
> 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: How to "hide" activity on BACK key without onDestroy?

2009-10-28 Thread tomei.ninge...@gmail.com

My activities's first screen shows a bunch of images. When I hit HOME
and then launch the app again, my app's first screen is displayed
instaneously.

If I hit BACK and launch the app again, the images are decoded again
and it takes about 200ms to show.

Is there anyway to reduce this 200ms time?

On Oct 28, 7:26 am, Streets Of Boston  wrote:
> I agree with Piotr.
>
> Tomei,
> We may be able to help you with the *how*, if you told us *what* you
> are trying to accomplish. I am almost 100% it could be done without
> trying to circumvent Android's lifecycle management.
>
> On Oct 28, 4:42 am, Piotr  wrote:
>
>
>
> > If you think how to get "around" application lifecycle, then you
> > project design is TOTALLY BAD. Really.
>
> > Redesign project.
>
> > On 28 Paź, 08:26, "tomei.ninge...@gmail.com"
>
> >  wrote:
> > > When user presses BACK key, my activity's onDestroy is called and then
> > > it is killed. Is there a way (by overridding Activity.onKeyDown??) to
> > > simply put the activity into background without killing it?
>
> > > I want the BACK key to act like the HOME key (which doesn't kill my
> > > app), except I want to show the activity immediately below my
> > > activity.
>
> > > Thanks!- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to "hide" activity on BACK key without onDestroy?

2009-10-28 Thread tomei.ninge...@gmail.com

I can handle "may be killed". I just don't want "killed for sure".

Anyone got an answer for this?

On Oct 28, 12:37 am, RichardC  wrote:
> You need to re-read the life-cycle documentation.  After pressing
> [home] your app may be killed at any time, it just hasn't been killed
> yet.
>
> If you need a background process read up on services.
>
> --
> RichardC
>
> On Oct 28, 7:26 am, "tomei.ninge...@gmail.com"
>
>
>
>  wrote:
> > When user presses BACK key, my activity's onDestroy is called and then
> > it is killed. Is there a way (by overridding Activity.onKeyDown??) to
> > simply put the activity into background without killing it?
>
> > I want the BACK key to act like the HOME key (which doesn't kill my
> > app), except I want to show the activity immediately below my
> > activity.
>
> > Thanks!- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to "hide" activity on BACK key without onDestroy?

2009-10-28 Thread tomei.ninge...@gmail.com

When user presses BACK key, my activity's onDestroy is called and then
it is killed. Is there a way (by overridding Activity.onKeyDown??) to
simply put the activity into background without killing it?

I want the BACK key to act like the HOME key (which doesn't kill my
app), except I want to show the activity immediately below my
activity.

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



[android-developers] Is HW OpenGL/ES used on G1?

2009-10-27 Thread tomei.ninge...@gmail.com

>From the adb log of my G1's boot time, it shows "requestGPU returned
-1", among other stuff. Does this mean that my OpenGL app is being
rendered using software?

BTW, I see the same messages on Hero as well.

Thanks

--- log begin
--

I/SurfaceFlinger(   81): SurfaceFlinger is starting
I/SurfaceFlinger(   81): SurfaceFlinger's main thread ready to run.
Initializing graphics H/W...
D/SurfaceFlinger(   81): pid 81 requesting gpu core (owner = -1)
W/SurfaceFlinger(   81): couldn't grant gpu core to pid 81
D/EGL (   81): requestGPU returned -1
E/libEGL  (   81): h/w accelerated eglGetDisplay() failed
(EGL_SUCCESS)
I/SurfaceFlinger(   81): EGL informations:
I/SurfaceFlinger(   81): # of configs : 6
I/SurfaceFlinger(   81): vendor: Android
I/SurfaceFlinger(   81): version   : 1.31 Android META-EGL
I/SurfaceFlinger(   81): extensions:
I/SurfaceFlinger(   81): Client API: OpenGL ES
I/EGLDisplaySurface(   81): using (fd=19)
I/EGLDisplaySurface(   81): id   = msmfb
I/EGLDisplaySurface(   81): xres = 320 px
I/EGLDisplaySurface(   81): yres = 480 px
I/EGLDisplaySurface(   81): xres_virtual = 320 px
I/EGLDisplaySurface(   81): yres_virtual = 960 px
I/EGLDisplaySurface(   81): bpp  = 16
I/EGLDisplaySurface(   81): r= 11:5
I/EGLDisplaySurface(   81): g=  5:6
I/EGLDisplaySurface(   81): b=  0:5
I/EGLDisplaySurface(   81): width= 45 mm (180.63 dpi)
I/EGLDisplaySurface(   81): height   = 67 mm (181.970154 dpi)
I/EGLDisplaySurface(   81): refresh rate = 60.00 Hz
W/HAL (   81): load: module=/system/lib/hw/copybit.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
copybit.trout.so' not found
W/HAL (   81): load: module=/system/lib/hw/copybit.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
copybit.trout.so' not found
I/SurfaceFlinger(   81): OpenGL informations:
I/SurfaceFlinger(   81): vendor: Android
I/SurfaceFlinger(   81): renderer  : Android PixelFlinger 1.0
I/SurfaceFlinger(   81): version   : OpenGL ES-CM 1.0
I/SurfaceFlinger(   81): extensions: GL_OES_byte_coordinates
GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format
GL_OES_compressed_paletted_texture GL_OES_draw_texture
GL_OES_matrix_get GL_OES_query_matrix GL_ARB_texture_compression
GL_ARB_texture_non_power_of_two GL_ANDROID_direct_texture
GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object
GL_ANDROID_generate_mipmap
W/HAL (   81): load: module=/system/lib/hw/copybit.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
copybit.trout.so' not found
W/HAL (   81): load: module=/system/lib/hw/copybit.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
copybit.trout.so' not found
W/HAL (   81): load: module=/system/lib/hw/overlay.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
overlay.trout.so' not found
W/HAL (   81): load: module=/system/lib/hw/overlay.trout.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
overlay.trout.so' not found
W/HAL (   81): load: module=/system/lib/hw/overlay.msm7k.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
overlay.msm7k.so' not found
W/HAL (   81): load: module=/system/lib/hw/overlay.default.so
error=Cannot load library: load_library[984]: Library '/system/lib/hw/
overlay.default.so' not found
I/sysproc (   81): System server: starting Android runtime.
I/sysproc (   81): System server: starting Android services.
I/SystemServer(   81): Entered the Android system server!
I/sysproc (   81): System server: entering thread pool.
I/SystemServer(   81): Starting Entropy Service.
V/RandomBlock(   81): reading from file /data/system/entropy.dat
V/RandomBlock(   81): writing to file /dev/urandom
V/RandomBlock(   81): reading from file /dev/urandom
V/RandomBlock(   81): writing to file /data/system/entropy.dat
D/SurfaceFlinger(   81): pid 89 requesting gpu surface (current owner
= -1)
D/SurfaceFlinger(   81): gpu surface granted to pid 89
D/SurfaceFlinger(   81): pid 89 requesting gpu surface (current owner
= 89)
D/SurfaceFlinger(   81): gpu surface granted to pid 89
D/SurfaceFlinger(   81): pid 89 requesting gpu core (owner = 89)
I/SystemServer(   81): Starting Power Manager.
I/SystemServer(   81): Starting Activity Manager.
D/EGL.oem (   89): SMI  region at virtual=0x4052c000, physical=0x0,
size=7340032 offset=0
D/EGL.oem (   89): EBI1 region at virtual=0x40c2c000,
physical=0x1650, size=8388608 offset=1228800
D/EGL.oem (   89): REGS region at virtual=0x4042c000,
physical=0xa000, size=1048576, offset=0
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups

[android-developers] How to read HTML in JavaScript

2009-10-19 Thread tomei.ninge...@gmail.com

Hello,

I know how to load an XML file into JavaScript (using
Window.XMLHttpRequest). However, on Android, is there a way use
Javascript to read an HTML page and save it into a string variable?
Like this:



var htmlData = getHtmlData("http://www.cnn.com";);



I know how to do this via WebView.addJavascriptInterface(), but is
there a way that this can be done completely within JavaScript?

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



[android-developers] How to find out if a device has flash player

2009-10-15 Thread tomei.ninge...@gmail.com

Is there a programmatic way on Android (inside Java code, or in
JavaScript code in a WebView) to determine if the device has flash
player?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Extremely long DNS lookup (and failure) on T-Mobile network

2009-10-14 Thread tomei.ninge...@gmail.com

More info: I found out that the web site returns multiple IP addresses
on the DNS lookup (see the "Resolving i2.sinaimg.cn line below). This
appears to be for load balancing purposes. Could this be the reason
that got Android confused?

$ wget http://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg
--23:20:59--  http://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg
   => `20091014235428.jpg.1'
Resolving i2.sinaimg.cn... 61.172.207.61, 61.172.207.62,
61.172.207.64, ...
Connecting to i2.sinaimg.cn|61.172.207.61|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 93,820 (92K) [image/jpeg]



On Oct 14, 9:53 pm, "tomei.ninge...@gmail.com"
 wrote:
> My problem may not be the same. I got this only on actual G1 device,
> not on emulator.
>
> Also, if G1 is connect to my home WiFi network (comcast), the DNS for
> i0.sinaimg.cn is resolved without any problem. However, if I
> disconnect Wifi and use TMO USA 3G network, the DNS never resolves.
>
> On Oct 14, 9:29 pm, for android  wrote:
>
>
>
> >http://code.google.com/p/android/issues/detail?id=2764
>
> > On Thu, Oct 15, 2009 at 4:40 AM, tomei.ninge...@gmail.com <
>
> > tomei.ninge...@gmail.com> wrote:
>
> > > Hello,
>
> > > This happens only when my G1 phone is on T-Mobile network:
>
> > > I found that when I try to go to the browser, and type the address
>
> > >    http://i0.sinaimg.cn/
>
> > > The browser tries to load the page, but no progress is shown for more
> > > than 2 minutes.
>
> > > (I have full 3G signal; all other addresses work just fine)
>
> > > Eventually when I tried to access this URL in my Java code, I found a
> > > similar long delay when I try to open the HttpUrlConnection, and
> > > eventually I get this exception:
>
> > > I/InetAddress( 1940): Unknown host i0.sinaimg.cn, throwing
> > > UnknownHostException
> > > W/System.err( 1940): java.net.UnknownHostException: Host is
> > > unresolved: i0.sinaimg.cn:80
> > > W/System.err( 1940):    at java.net.Socket.connect(Socket.java:1002)
>
> > > Why would DNS take so long? Also, if my program tries to issue the
> > > same HTTP request again, the same 2+ minute blocking happened.
>
> > > Is this an Android bug or a T-Mobile infrastructure bug? It seems the
> > > Android API should try to time-out faster, especially on the second
> > > attempt.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Extremely long DNS lookup (and failure) on T-Mobile network

2009-10-14 Thread tomei.ninge...@gmail.com

My problem may not be the same. I got this only on actual G1 device,
not on emulator.

Also, if G1 is connect to my home WiFi network (comcast), the DNS for
i0.sinaimg.cn is resolved without any problem. However, if I
disconnect Wifi and use TMO USA 3G network, the DNS never resolves.

On Oct 14, 9:29 pm, for android  wrote:
> http://code.google.com/p/android/issues/detail?id=2764
>
> On Thu, Oct 15, 2009 at 4:40 AM, tomei.ninge...@gmail.com <
>
>
>
> tomei.ninge...@gmail.com> wrote:
>
> > Hello,
>
> > This happens only when my G1 phone is on T-Mobile network:
>
> > I found that when I try to go to the browser, and type the address
>
> >    http://i0.sinaimg.cn/
>
> > The browser tries to load the page, but no progress is shown for more
> > than 2 minutes.
>
> > (I have full 3G signal; all other addresses work just fine)
>
> > Eventually when I tried to access this URL in my Java code, I found a
> > similar long delay when I try to open the HttpUrlConnection, and
> > eventually I get this exception:
>
> > I/InetAddress( 1940): Unknown host i0.sinaimg.cn, throwing
> > UnknownHostException
> > W/System.err( 1940): java.net.UnknownHostException: Host is
> > unresolved: i0.sinaimg.cn:80
> > W/System.err( 1940):    at java.net.Socket.connect(Socket.java:1002)
>
> > Why would DNS take so long? Also, if my program tries to issue the
> > same HTTP request again, the same 2+ minute blocking happened.
>
> > Is this an Android bug or a T-Mobile infrastructure bug? It seems the
> > Android API should try to time-out faster, especially on the second
> > attempt.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Extremely long DNS lookup (and failure) on T-Mobile network

2009-10-14 Thread tomei.ninge...@gmail.com

Hello,

This happens only when my G1 phone is on T-Mobile network:

I found that when I try to go to the browser, and type the address

http://i0.sinaimg.cn/

The browser tries to load the page, but no progress is shown for more
than 2 minutes.

(I have full 3G signal; all other addresses work just fine)

Eventually when I tried to access this URL in my Java code, I found a
similar long delay when I try to open the HttpUrlConnection, and
eventually I get this exception:

I/InetAddress( 1940): Unknown host i0.sinaimg.cn, throwing
UnknownHostException
W/System.err( 1940): java.net.UnknownHostException: Host is
unresolved: i0.sinaimg.cn:80
W/System.err( 1940):at java.net.Socket.connect(Socket.java:1002)

Why would DNS take so long? Also, if my program tries to issue the
same HTTP request again, the same 2+ minute blocking happened.

Is this an Android bug or a T-Mobile infrastructure bug? It seems the
Android API should try to time-out faster, especially on the second
attempt.



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



[android-developers] Debug on a remote emulator

2009-10-12 Thread tomei.ninge...@gmail.com

Hello,

I am running Eclipse on Win32 and my Android emulator on Linux.

Is there a way to use Win32 eclipse to debug code on the emulator that
runs on Linux?

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



[android-developers] Re: Can WebView be used inside a Service?

2009-10-09 Thread tomei.ninge...@gmail.com

Thanks Miguel,

Can a service launch an activity? I need to run something periodically
using JavaScript (say every 4 hours). Porting Rhino probably won't
work for me because I use a lot of large Strings, and putting that in
the Java heap will soon fragment it very bad ...


On Oct 9, 3:26 am, Miguel Paraz  wrote:
> Hi,
> I looked into this myself...
>
> On Oct 9, 3:00 pm, "tomei.ninge...@gmail.com"
>
>  wrote:
> > I want to run part of my app logic in a background service. However,
> > much of the app uses JavaScript. Currently I run the JavaScript inside
> > a WebView.
>
> > Is it possible to have an invisible WebView while running inside a
> > Service?
>
> No, only only an Activity can have Views.
>
> > If the answer is no, is there any way to run JavaScript inside a
> > Service?
>
> If it's the JavaScript language, it may be possible to port Rhino to
> Android. But, the performance won't be so good because JIT compiling
> must be disabled.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Can WebView be used inside a Service?

2009-10-09 Thread tomei.ninge...@gmail.com

I want to run part of my app logic in a background service. However,
much of the app uses JavaScript. Currently I run the JavaScript inside
a WebView.

Is it possible to have an invisible WebView while running inside a
Service?

If the answer is no, is there any way to run JavaScript inside a
Service?

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



[android-developers] Is network slower when screen is blacked out?

2009-10-08 Thread tomei.ninge...@gmail.com

I have an app that keeps pulling data from the network. I noticed that
my downloading speed seems to have slowed down if I let the phone's
screen to black out.

Is this true?

Is there a way to tell Android "keep using full network speed even
when screen is blacked out"?

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



[android-developers] Re: WebView.loadDataWithBaseURL bug

2009-09-30 Thread tomei.ninge...@gmail.com

I found the ultimate work-around. After the page is loaded, iterate
through all links, and manually fix the ones that are problematic:

function markup_links() {
for (var i=0; i < document.links.length; i++) {
var li = document.links[i];
if (li.href == ..) {
/* fix the li's style to an inactive link */
}
}
}

I just run this code at the end of the data to be loaded into WebView.

On Sep 20, 11:39 pm, "tomei.ninge...@gmail.com"
 wrote:
> My work-around works for all cases except one: if the page contains
> this link:
>
> click
>
> When the user clicks the link, shouldOverrideUrlLloading is not
> called.
>
> On Sep 18, 5:15 pm, Jason Proctor 
> wrote:
>
> > you probably want to set the web view client before calling any
> > variant of load().
>
> > there are some strange things associated with loadDataWithBaseURL()
> > and base URLs, search the archives. sometimes the WebView loads the
> > base URL instead of the provided data, i've never really got to the
> > bottom of it.
>
> > another thing you are probably running into is that
> > shouldOverrideUrlLoading() is not called on reloading the same page.
> > that's a nasty bug that's caused me some trouble. sounds like you can
> > work around it by faking a parameter, but that didn't work for me in
> > my case.
>
> > hth
>
> > >Has anyone seen this?
>
> > >webView.loadDataWithBaseURL("http://www.google.com";,
> > >"http://www.google.com>click", "text/html", "utf-8", nul);
> > >webView.setWebViewClient(new WebViewClient() {
> > >     public boolean shouldOverrideUrlLloading(WebView w, String url) {
> > >         System.out.println(url);
> > >         return true;
> > >     }
> > >});
>
> > >When user clicks the link, my shouldOverrideUrlLloading() function is
> > >not called. Instead, the WebView just goes out to fetch the real
> > >www.google.compage.
>
> > >For the time being, my work-around is to append "?foo=bar" into the
> > >baseURL.
>
> > >Is there a better work around?
>
> > >Thanks
>
> > --
> > jason.vp.engineering.particle- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView.loadDataWithBaseURL bug

2009-09-20 Thread tomei.ninge...@gmail.com

My work-around works for all cases except one: if the page contains
this link:

click

When the user clicks the link, shouldOverrideUrlLloading is not
called.

On Sep 18, 5:15 pm, Jason Proctor 
wrote:
> you probably want to set the web view client before calling any
> variant of load().
>
> there are some strange things associated with loadDataWithBaseURL()
> and base URLs, search the archives. sometimes the WebView loads the
> base URL instead of the provided data, i've never really got to the
> bottom of it.
>
> another thing you are probably running into is that
> shouldOverrideUrlLoading() is not called on reloading the same page.
> that's a nasty bug that's caused me some trouble. sounds like you can
> work around it by faking a parameter, but that didn't work for me in
> my case.
>
> hth
>
>
>
>
>
> >Has anyone seen this?
>
> >webView.loadDataWithBaseURL("http://www.google.com";,
> >"http://www.google.com>click", "text/html", "utf-8", nul);
> >webView.setWebViewClient(new WebViewClient() {
> >     public boolean shouldOverrideUrlLloading(WebView w, String url) {
> >         System.out.println(url);
> >         return true;
> >     }
> >});
>
> >When user clicks the link, my shouldOverrideUrlLloading() function is
> >not called. Instead, the WebView just goes out to fetch the real
> >www.google.compage.
>
> >For the time being, my work-around is to append "?foo=bar" into the
> >baseURL.
>
> >Is there a better work around?
>
> >Thanks
>
> --
> jason.vp.engineering.particle- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: save new file into asset directory from app

2009-09-18 Thread tomei.ninge...@gmail.com

I know one way that works for sure. Open a server socket inside your
app, then specify http://localhost:1234 inside WebView. This seems
like a hack (and maybe it is :-) but it's much simpler than fighting
with WebView.

On Sep 18, 10:41 am, Jason Proctor 
wrote:
> i had all kinds of trouble trying to get WebKit to load local
> resources, and implemented my own content provider to deal with some
> kinds of content: URLs. i ran into issues even then, and eventually
> had the content provider cache stuff from my assets directory in
> /sdcard.
>
> hth
>
>
>
> >Hi Mark,
>
> >I have given the fully-qualified url of CSS. But don't know why this
> >is happening.
>
> >I will make small app and will try to open an issue on this if could
> >not get answer on this forum.
>
> >Ideas from the experts are very much welcome.
>
> >Thanks,
> >AJ
>
> >On Sep 18, 4:13 pm, Mark Murphy  wrote:
> >>  AJ wrote:
> >>  > If we try to load local HTML file [through ContentProvider] in which
> >>  > the css is specified with "import" keyword, the css deoes not get
> >>  > properly applied.
>
> >>  I am very much *not* a CSS expert. With that in mind:
>
> >>  -- have you tried fully-qualifying the URL you use with @import?
>
> >>  -- is there a reason you use @import versus a stylesheet  element?
>
> >>  Also, since I do not see a bug report for this out
> >>onhttp://b.android.com, if you can create a small project that
> >>reproduces
> >>  the error, you might want to open an issue on it, so that it is more
> >>  likely to get investigated.
>
> >>  --
> >>  Mark Murphy (a Commons
> >>Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> >>  Android Development Wiki:http://wiki.andmob.org
>
> --
> jason.vp.engineering.particle
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 create multi-language application?

2009-09-18 Thread tomei.ninge...@gmail.com

I read http://developer.android.com/guide/topics/resources/resources-i18n.html.
But it shows how to localize your app for the currently selected
locale of the phone. However, I want to add a "language" option into
my own app, and allow the user to switch the UI language independent
of the phone's locale setting.

My currently solution is to manage a string table myself, and
dynamically edit the text string of every UI element. However, this is
rather tedious. Is there a better way?

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