Home Screen Detection

by GodsMoon » Fri, 28 Aug 2009 05:43:24 GMT


Sponsored Links
 I'm writing a back ground app and would like to be able to tell which
app is currently running (actually has focus).
I'm particularly interested in if the Home screen is being shown.
Can anyone help with this?
--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Fri, 28 Aug 2009 06:25:25 GMT


 That might be enough info for my app.
Which api are you looking at?





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Home Screen Detection

by Chris Stratton » Fri, 28 Aug 2009 08:23:50 GMT


 


I got stumped on that too.

There is a call that will get a list of what is running and tell if it
has user-interactive level of priority, but that's not unique enough -
a few things (in call screen for example) keep this even when their
window is not visible.  Another problem is that latin input method can
show up in the list interactive priority, but you don't know what
application it is accepting input on behalf of.
--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Hong » Sat, 29 Aug 2009 01:47:44 GMT


 ActivityManager : getRunningTasks(int)





--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sat, 29 Aug 2009 01:49:21 GMT


 I was looking at the Package Manager api, but it looks like the
Process api might be more useful.
 http://developer.android.com/reference/android/os/Process.html 
Has anybody used this before or have an example?





--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sat, 29 Aug 2009 01:54:49 GMT


 What's the difference between a Task and a Process for
ActivityManager?




--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Dianne Hackborn » Sat, 29 Aug 2009 02:42:07 GMT


 They are described here:
 http://developer.android.com/guide/topics/fundamentals.html 








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

--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sun, 30 Aug 2009 01:00:53 GMT


 I have a solution for home screen detection, but its slow and
horrible.
I run this bit of code every 1 seconds.

ActivityManager actvityManager = (ActivityManager)
this.getSystemService( ACTIVITY_SERVICE );
                List<RunningAppProcessInfo>  procInfos =
actvityManager.getRunningAppProcesses();

                for(int i = 0; i < procInfos.size(); i++)
                {

                        if(procInfos.get(i).processName.compareTo
( "android.process.acore") == 0
                                        && procInfos.get(i).importance ==
RunningAppProcessInfo.IMPORTANCE_FOREGROUND)
                        {

                                // Home Screen Detected! Do something...
                        }

                }

I hate continually polling a piece of code but I don't think there is
a broadcast intent that will help me out.

Do anybody know of a better way of doing this?






--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Dianne Hackborn » Sun, 30 Aug 2009 02:36:58 GMT


 No there is no API to do this.  What are you trying to accomplish?

Note that your code will break in many many situations -- when a custom home
screen is being used, on a device where the manufacturer is not using the
base platform home app, in the future when we have more memory so don't need
to run home in a shared process, etc.










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

--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sun, 30 Aug 2009 02:53:30 GMT


 'm writing an app that turns off the keyguard and I would like to
exitKeyguardSecurely when you user goes back to the home screen.
This works great when hitting the Home button, but the user can back
to the home screen without prompt by using the back button (I think
this is an API bug).
So I'm trying to determine if the Home screen is displayed so I can
force exitKeyguardSecurely.

I realize homescreen replacements will break this code but until the
API bug gets fixed I don't see a good way around this.

On Aug 29, 2:35pm, Dianne Hackborn <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Dianne Hackborn » Sun, 30 Aug 2009 03:56:34 GMT


 




What API bug?  Of course you can press back to go to the home screen.

What are you doing to determine when the user presses home?  Afaik there
isn't really a way to do this since the system completely consumes the home
key.

Unfortunately, I don't think there is any robust way to do what you want.  I
can't imagine an app being able to do this consistently with the current
API...  and that should kind-of give you a moment of pause since you are
messing with the lock screen and thus fundamental security of the device.

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

--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sun, 30 Aug 2009 04:31:30 GMT


 Dianne Hackborn,
Are you familiar with the KeyguardManager class? Its really cool, I
haven't seen anything like it on any other platform and I'm excited to
take advantage of it.
 http://developer.android.com/reference/android/app/KeyguardManager.html 

It can take over the Home screen button

I've created a bug report.
 http://code.google.com/p/android/issues/detail?id=3715 

Thanks for your help.






--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Dianne Hackborn » Sun, 30 Aug 2009 07:40:59 GMT


 




Yes I am.




I don't know what you mean.  As far as I know, it has nothing to do with the
home screen button, it just controls whether the lock screen is shown.




I've closed this as work as intended, because what you are requesting is not
how it is supposed to work.

You could look at the AlarmClock app to see an example if the API's use.

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

--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by GodsMoon » Sun, 30 Aug 2009 09:24:49 GMT


 I admit that what I'm trying to do is a little unorthodox and somewhat
creative. The idea I have does slightly change the way security works
on the phone. However, I don't think I'm abusing the API or decreasing
security. Its somewhat hard to explain my app idea. I will be
releasing a video of my app in action for the ADC2 fairly soon.
I'll post back here once it is released the video. I'd love to get
feedback to make sure I'm not doing anything I'm not suppose to.

Thanks for your help.





--~--~---------~--~----~------------~-------~--~----~



Home Screen Detection

by Hong » Fri, 04 Sep 2009 05:49:14 GMT


 I found the video:
 http://www.youtube.com/watch?v=ipue9Yhi5VA 

NICE WORK!





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. android-x86 generic-x86 target: kvm-qemu VGA error

Hi
I just verified that with kvm qemu, I am able to create other guest OSes
like gentoo linux from iso image and I did not get the VGA problem I got
with 'android-x86 for generic_x86' target iso image.
Has anyone faced something like this before? Also do I need to customize the
configuration in kernel or something like that?
This is what I did.
1. Downloaded the source from http://www.android-x86.org/getsourcecode
2. Added the KVM module support to the default kernel config that comes with
android-x86 source.
3. compiled the source like  make iso_img TARGET_PRODUCT=generic_x86 and
used the iso image with kvm-qemu on top of ubuntu-9.10.
That is when I ran in to cirrus-vga problem.

It would be gr8 if someone can tell how to fix this.
Thanks :)

On Wed, May 12, 2010 at 3:19 PM, sreenaath vasudevan






-- 
regards
sreenaath

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. For X10i User. Ada yang pernah install update service nya X10i

Jawabannya kalau sudah konek : anda menggunakan the latest version :-)

Mohammad Jaedi
Fri, May 14, 2010 - 06:34:32 
-----Original Message-----
From: Reza Iransah <logay.pek...@gmail.com>
Date: Wed, 12 May 2010 21:17:45 
To: Indonesian Android Community [id-android]<id-android@googlegroups.com>
Subject: [id-android] Re: [WTA] For X10i User. Ada yang pernah install update 
        service nya X10i?

Gagal aja, tiap kali di sambungin USB antara Handset sama PC, PC nya
nge hank....coba di laptop juga sama....

dia minta di matiin handset terus cabut batere,setelah itu masukin
batere lagi,lalu di sambungkan ke PC sambil tombol BACK terus di
tekan....

tapi nunggu sampe kapan ga masuk-masuk....sampe panas JEMPOL gw
nih....

aples aples....

dan diakhiri dengan PC ato Laptop Nge-hank...

siapa tau ada yang bisa kasih tutorial nih....











> Join:

3. (ASK) Cara install di phone memory kalo ud app2sd?

4. <SHARE> Software Camera

5. usb hub not picking up- android on beagle

6. How to get activity to restart every time the app is launched from the command line

7. playback suddenly stopping...