[Q] How to support multiple APIs ? - Android Software Development

Hi guys,
I'm developing an app for a blog and wanted to implement pinch-tozoom on the image viewer but still support the app all the way back since 1.6.
In such a manner I was developing everyinthg in 1.6, and the moment I went to implement the pinch-to-zoom I changed to 2.1 and included the code that selects if API > 5 hide the ZoomControls and process pinch-to-zoom, else show zoom controls and do not process pinch-to-zoom.
My problem is that my manifest MinSDK is 4 and Eclipse keeps giving me the warning: Attribute minSdkVersion (4) is lower than the project target API level (7)
How do I fix that? what is the correct way to support multiple APIs?
thanks!

I believe this is a warning you should just ignore. If you right click it, and do delete, does it go away?

it does go away, but as soon as the app re-builts it comes back again.
yes, it is just a warning, it does compile and installs... but it's just weird, there should be away for the compiler to understand that I'm using multiple versions...

maybe submit as a bug to google?

It's not a bug, just ignore it. It's just warning you that you need to do things like not use code from the new SDK unless you've checked the user's SDK_INT
But you're already doing that so just ignore it.

well... I wish there was a way to better surround this, but Ok, I'll keep an eye on it.
Maybe I'll even comment out that part, finish the development on 1.6 and then re-enable it... just to be sure!
thanks!

Isnt that set in your manifest? what SDK version is set there?

rob17 said:
Isnt that set in your manifest? what SDK version is set there?
Click to expand...
Click to collapse
yes it is.
Min SDK 4 and Target SDK 7
but Eclipse still gives me warnings about it... I'll just have to live with it.
thanks.
ps.: if some forum moderator sees this and fancy closing the thread I guess it's ok.

Related

[Q] Modify stock mail app?

First off, I'm brand new to Android development so please bear with me.
My only goal at this point is to add the ability to choose the notification LED color to the Android 2.2 stock mail app (on the Droid). I've searched all over the place and haven't found an existing solution for this yet.
It seems to me like it should be super easy to add this functionality to the stock mail app. I can already choose my sound and vibrate settings, why not the LED color? Toss in some notification.ledARGB = something (plus the few other lines of code to make it work), a list to choose the color and we're good to go.
My problem, though, is I have no idea where to begin to have access to the code of the stock mail app. I would guess it goes something like:
1. Download the apk
2. Somehow open the source
3. Make the changes I need
4. Turn it back into a useable apk
5. Swap out the existing apk with my new modified one on the phone
I really only care about making this work on my own phone, so I'm not worried about signing the apk with a public cert or anything. I'm rooted as well, so no worries there.
Anyone have any insight? If I basically have the right plan of attack, and advice on the specifics? If I'm totally wrong in my approach, any advice on what I should be doing would be greatly appreciated.
Thanks in advance for any help!
I think this app is a part of AOSP, so you don't have to decompile an apk - grab sources and build them.
Well, that certainly makes sense. Just did some digging, and I found a pile of info about getting the source, git, repo, etc.
Naturally I'm a windows user, so it looks like I'll need to get some linux up and running to actually do anything with the source code. Ubuntu is installing as we speak....
Any tips on what to do next for a newbie like me?
Should I follow all the directions to get Eclipse ready to develop on the linux box?
Do I just need to download the Email.git to do what I want?
What do I do with the Email.git once I've gotten it?
Just gonna give this a little bump. I've got my linux box all set up and i've got the entire android source downloaded. I'm not really sure where to go from here, though.
How do I just modify and compile the email app into an apk? Thanks for any forthcoming handholding, guys.

[Q] Debugging help needed

I have a user of my app who is having a problem running it. My code launches another activity in the same app, and he is saying it is stopping before it should & returning to the previous activity, and he doesn't see any Force Close warnings.
I have run my code in the emulator & on my phone, I can't reproduce the error. We both run Android 2.2 on our phones, his is an HTC EVO & mine is a HTC Wildfire, as far as I can tell his specs are better than mine so shouldn't cause an issue - I deliberately chose a low spec for for my dev work so the code ought to run on anything.
As a bit of an Andoid dev noob (but been coding for years), is there any easy way I can make a special build of the app to send to him that would log any errors that happen ? I'd like to get a stack dump as well if possible, as I'm not sure exactly what routine in the activity its crashing out in. The activity that crashes is Gallery with 9 images in it, he can't flick through them or select one. I'm stumped as to whats causing it, any assistance would be gratefully received.
Thanks.
Why not point to your app and let others here try it on their phones? It could simply be other apps installed on his phone interfering with your app.
Long time programmer here too and when I get to where you're at (and I"m sure you've put some hours into this LOL), I go back to STEP 1.
I comment-out any and all code but the bare minimum; break it down to the Intent, startActivity and maybe a Toast message in the second activity. Even parse down your XML files to bare minimum.
See if that works. Then, ADD BACK ONE LINE OF CODE AT A TIME Run program and make sure it works. Yeah, it's painful, but in my 20 years of coding, I've learned to put my pride aside and to not "pretend" all the code I've written is correct.
Sometimes on bigger projects, I"ll change or add a couple of lines of code, run a back up and test. Rinse and repeat LOL. That way, I know I"m only a couple of lines of code from what "used" to work.
Good Luck!
Thanks both of you.
old_dude - Its a paid app. Only £0.99 but I don't think people would pay to help me. There is a free version of the same app (with less functionality) that this guy can get to work. If your really interested the 2 versions are -
Plink Log - Free Version
Plink Log Pro - Paid version
Rootstonian - agreed thats the approach I'd normally take if I was having problems on my dev phone or the emulator. The problem is that its OK on my HTC Wildfire/Android2.2 but on this guys HTC EVO/Android2.2 its having problems. I dont really want to keep sending him .apks with 1 or 2 lines extra enabled just to see if that fixes his specific issue. I was hoping there was something I could code to catch whatever crashes the activity & log it somewhere for me to analyse. When I do PC dev work, I have a global exception handler that catches anything I dont explicitly handle, and dumps the full call stack into a Log File I can read later.
I think I'll just have to take the existing app & put loads of debug code into it to save messages into a log file & see what bits of code are being called & what isn't & then get him to email me the results.
Thanks for the ideas guys, its always useful to get input from another perspective.
Dave
Hmmmm, just discovered setDefaultUncaughtExceptionHandler - might be able to use that with printStackTrace. Sounds interesting.

[Android studio] why do I have to reopen my project to debug my app

I am new to app developing and I'm excited to learn, I've created some example apps for me to learn features and develop mechanics.
but lately I've because frustrated, debugging is a *****, and even more, whenever I want to debug or run my latest changes on my device I am forced to exit Android studio, re open the project and run\debug it again, every time I make changes.
If I will try to debug the application again with the new changes it will remain the same, even after I uninstalled the deployed apk on my device(SGS 3)...
This is frustrating, please help me
umlal said:
I am new to app developing and I'm excited to learn, I've created some example apps for me to learn features and develop mechanics.
but lately I've because frustrated, debugging is a *****, and even more, whenever I want to debug or run my latest changes on my device I am forced to exit Android studio, re open the project and run\debug it again, every time I make changes.
If I will try to debug the application again with the new changes it will remain the same, even after I uninstalled the deployed apk on my device(SGS 3)...
This is frustrating, please help me
Click to expand...
Click to collapse
I don't use Android Studio so can't be 100% sure, but it just sounds like you need to rebuild the project and reloading it forces the IDE to do so. I'm used to IDEs detecting the fact that you've made changes and automatically rebuilding when you want to run in debug mode, but maybe Android Studio doesn't do that. It could also be a setting somewhere - "Always build project" or something similar.
Just try a manual build and the run in debug mode. You shouldn't need to restart the whole IDE unless there is a problem with it.
Archer said:
I don't use Android Studio so can't be 100% sure, but it just sounds like you need to rebuild the project and reloading it forces the IDE to do so. I'm used to IDEs detecting the fact that you've made changes and automatically rebuilding when you want to run in debug mode, but maybe Android Studio doesn't do that. It could also be a setting somewhere - "Always build project" or something similar.
Just try a manual build and the run in debug mode. You shouldn't need to restart the whole IDE unless there is a problem with it.
Click to expand...
Click to collapse
Thanks for you comment, I appreciate it.
I've tried the settings, it should rebuild it everytime, I tried to "make"\build it again, then rerun it, I also tried to reload the adb, but still nothing works, at this point, I've become frustrated and I'm trying eclipse+android plugin.
umlal said:
Thanks for you comment, I appreciate it.
I've tried the settings, it should rebuild it everytime, I tried to "make"\build it again, then rerun it, I also tried to reload the adb, but still nothing works, at this point, I've become frustrated and I'm trying eclipse+android plugin.
Click to expand...
Click to collapse
It was worth mentioning - I don't know your level of experience so I had to assume the lowest common denominator
I've had a google and haven't found anything about it, so that obviously suggests that it's not a common bug. It just sounds strange to me. Sorry I can't be any help.
Archer said:
It was worth mentioning - I don't know your level of experience so I had to assume the lowest common denominator
I've had a google and haven't found anything about it, so that obviously suggests that it's not a common bug. It just sounds strange to me. Sorry I can't be any help.
Click to expand...
Click to collapse
I'll assume you're an expert on eclipse and address this question to you:
When I was using the Android studio It auto completed my commands(just like in visual studio) but in eclipse this is missing, I couldn't find a setting for that, google is no help and I just rage quit eclipse back to Android studio...
umlal said:
I'll assume you're an expert on eclipse and address this question to you:
When I was using the Android studio It auto completed my commands(just like in visual studio) but in eclipse this is missing, I couldn't find a setting for that, google is no help and I just rage quit eclipse back to Android studio...
Click to expand...
Click to collapse
Actually, I'm a Windows developer, so I'm a Visual Studio user too. A quick search found this though...
http://stackoverflow.com/questions/2943131/eclipse-intellisense
Archer said:
Actually, I'm a Windows developer, so I'm a Visual Studio user too. A quick search found this though...
Click to expand...
Click to collapse
Ok, thanks for your comment but I knew about the setup option, nvm.
the fix to my problem was to insert every possible combination of keys to initiate the auto complete:
"qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ.("
That way every time I start typing it will try and help me complete. something Android Studio does automatically.
Edit : I figured that this can also be achieved by Ctrl+Space combination. also if someone has any clue about why it sometimes auto-insert when I type (for example when I do "R.id" it will replace the R with the first thing in the list when I click ".").

[Q] Spawning native processes from java

according to developer.android.com/reference/java/lang/Process.html you can spawn a native executable from within your java application. This is not working for me as I had hoped....
I have an ARM Linux Forth that I have developed and this runs just fine from adb shell. I have placed this in my assets directory and copied it out to /data/data/blah.blah/ and tried to execute it there from my app. it runs but is instantly killed. dmesg tells me it was killed because it is an untrusted app.
How is one supposed to execute native binaries from within a security enhanced android? or has this functionality been buggered up by google now?
P.S. i click yes this is a question and am told im breaking the rules. I back out, i follow what LOOKS like the links to the Q/A forums which leads me right back to here so if im breaking the rules YOUR site is screwed up.
p.p.s the capcha that you have implemented for the registration with this site is PERFECT. the capcha you have chosen for posting is a HORRENDOUSLY BAD capcha, its almost completely and utterly unreadable by a human... i bet a bot could read it just fine though!
Plese delete this dumbass capcha and use only the one used for registering here.. i.e. the one that asks you to enter the numbers not totally butchered words that are so skewed as to be incomprehensible!
???
mark4th said:
according to developer.android.com/reference/java/lang/Process.html you can spawn a native executable from within your java application. This is not working for me as I had hoped....
I have an ARM Linux Forth that I have developed and this runs just fine from adb shell. I have placed this in my assets directory and copied it out to /data/data/blah.blah/ and tried to execute it there from my app. it runs but is instantly killed. dmesg tells me it was killed because it is an untrusted app.
How is one supposed to execute native binaries from within a security enhanced android? or has this functionality been buggered up by google now?
P.S. i click yes this is a question and am told im breaking the rules. I back out, i follow what LOOKS like the links to the Q/A forums which leads me right back to here so if im breaking the rules YOUR site is screwed up.
p.p.s the capcha that you have implemented for the registration with this site is PERFECT. the capcha you have chosen for posting is a HORRENDOUSLY BAD capcha, its almost completely and utterly unreadable by a human... i bet a bot could read it just fine though!
Plese delete this dumbass capcha and use only the one used for registering here.. i.e. the one that asks you to enter the numbers not totally butchered words that are so skewed as to be incomprehensible!
Click to expand...
Click to collapse
nobody can tell me how to spawn native processes without them being instantly killed?
You didn't post any code or something...
Regards
1. Post your code.
2. Since more than half of your question was about complaints, go here.
www.xda-developers.com/contact/
Code.
EmptinessFiller said:
You didn't post any code or something...
Regards
Click to expand...
Click to collapse
would it be possible for you to private message me an email address, my code is not "secret" but it is not released yet and the site i host my projects on is currently down due to my domain name expiring. this will take a few days to resolve still.
Basically i have an ARM forth compiler that I developed on my BeagleBoard XM (in ARM assembler). This runs on the XM, the raspberry pi and of course android. Well, it runs in adb shell on a rooted device just fine, if my java launches it as a native process (not a native application) it is instantly killed due to being an untrusted executable. This does not happen on older androids but I would like this to run on any newer device too.
I would be MORE than happy to send you the entire sources to my ARM forth so you can observe the instant death first hand. I will also post the "java" code i use to launch it from my main android app - im not yet ready to release this arm forth to the general public yet so im not going to be posting it on any site like github etc.
Part of the problem is that on launch the Forths process resides within a contiguous 1 meg region (code and data) that I mprotect to +r +w +x. If i cannot have the entire process space readable, writeable AND executable then this forth will never run on a security enhanced android. I seriously hope this is not the case and that there is a fix.
I think it's better to post smallest part that is necessary for ur problem public in this forum, so that all the other great members can help u too. You needn't post everything.
Regards
code..
EmptinessFiller said:
I think it's better to post smallest part that is necessary for ur problem public in this forum, so that all the other great members can help u too. You needn't post everything.
Regards
Click to expand...
Click to collapse
create any native executable using the NDK or any other armv6/v7 compiler/assembler. put this in /data/data/com.somewhere/ then use the every so INCOMPLETE example snippet provided by google at developer.android.com/reference/java/lang/Process.html to run that executable from within some hello-world android app. I do this with my forth compiler (www dot isforth dot com/a4.tar.bz2) and the executable is instantlhy killed by the android security enhancement bs.
it only took about 200 ish tries on this stupid capcha to finally be able to HUMANY FREEKING READ IT!
hate this bull****
mark4th said:
create any native executable using the NDK or any other armv6/v7 compiler/assembler. put this in /data/data/com.somewhere/ then use the every so INCOMPLETE example snippet provided by google at developer.android.com/reference/java/lang/Process.html to run that executable from within some hello-world android app. I do this with my forth compiler (www dot isforth dot com/a4.tar.bz2) and the executable is instantlhy killed by the android security enhancement bs.
it only took about 200 ish tries on this stupid capcha to finally be able to HUMANY FREEKING READ IT!
hate this bull****
Click to expand...
Click to collapse
well nobody seems to be able to tell me why i cannot spawn a native process so i converted my native process into a native dynamic library. this instantly segfaults any time i try exeucte a swi 0 opcode. can someone please tell me why i am not able to make system calls in native code? please dont tell me to link to some external library, this IS the external library.
some code...
.section userData, "w" @Nobits
userList:
.space 0x00100000
this enlarges the resultant object module by 0x01000000 bytes so the android NDK seems to be ignoring the @Nobits
ldr r1, = userList
str r1, [r1]
this segfaults so the android NDK seems to be ignoring the "w" flag.
:/
any swi 0 anywhere inside my library, no matter what the system call instantly segfaults. is there some perms i need to set in my manifest to allow my library to make system calls?

ExtensibilityApp class in WP 8.1 Silverlight

Hi all,
If you've read the text that USED to exist here before, scratch that. Big Thanks to @Sunius1 for clarifying what I thought was a win. Due to this, I DID find something interesting in regards to the ExtensibilityApp class (Windows.Phone.System.LockscreenExtensibility.ExtensibilityApp). I happened to also find a hidden capability "ID_CAP_SHELL_DEVICE_LOCK_UI_API" (Seems to be a locked CAP because it only works on Emulator. I get a deployment error on my if I try including this capability). I suspected that these two worked together, but I wanted to make sure of this.
Before we get started, read through the documentation from this site: http://msdn.microsoft.com/en-us/lib...lockscreenextensibility.extensibilityapp.aspx.
We have the following methods:
BeginUnlock
EndUnlock
GetLockPinpadHeight
IsLockScreenApplicationRegistered
IsSystemOverlayApplicationRegistered
RaiseToastNotifications
RegisterLockScreenApplication
RegisterSystemOverlayApplication
UnregisterLockScreenApplication
UnregisterSystemOverlayApplication
EDIT: After the release of the Live Lock Screen app, my speculations about the ID_SHELL_CAP_DEVICE_UI_API capability and the ExtensibilityApp object were correct. Thanks to @jessenic for finding out a good bit of info on this with me.
It seems that in order to get this working, we have to add an Extension to the WMAppManifest.xml
<Extension ExtensionName="LockScreen_Application" ConsumerID="XXXXX" TaskID="_default" ExtraFile="Extensions\\LockAppExtension.xml" />
In the LockAppExtension.xml:
<?xml version="1.0"?>
<x:Extension xmlns:x="urn:LockApp">
<AppID>AppNameForLockScreen</AppID>
</x:Extension>
As usual, Microsoft doesn't really give us much in terms of documentation.. Probably because it isn't meant to be used by the normal developer Confirmed: For now we have to actually ask for permission in order to use the cap. As to whether we'll get that granted? Who knows....
All of these methods have no parameters at all, but I can almost guarantee this has to do with having an application that can control the lock screen.
This thread will be for efforts in breaking this open and seeing whether we can create lockscreen applications..
Homebrew Lockscreen Apps:
Lockscreen App by @-W_O_L_F-
There are actually two Windows.winmd files in Windows Phone SDK, one for Silverlight 8.1 apps and one for Jupiter 8.1 phone apps (located in C:\Program Files (x86)\Windows Phone Silverlight Kits\8.1\ and C:\Program Files (x86)\Windows Phone Kits\8.1\). There's only one the phone. And some APIs support only one app type (it's phone limitation it seems: faking .winmd file results in Platform::InvalidOperationException, saying you cannot use that API from this app type). That explains why the one on the phone has more APIs available than either of for single app type.
As for LockscreenExtensibility - it's documented, just not available for Jupiter apps:
http://msdn.microsoft.com/en-us/lib...ows.phone.system.lockscreenextensibility.aspx
Sunius1 said:
There are actually two Windows.winmd files in Windows Phone SDK, one for Silverlight 8.1 apps and one for Jupiter 8.1 phone apps (located in C:\Program Files (x86)\Windows Phone Silverlight Kits\8.1\ and C:\Program Files (x86)\Windows Phone Kits\8.1\). There's only one the phone. And some APIs support only one app type (it's phone limitation it seems: faking .winmd file results in Platform::InvalidOperationException, saying you cannot use that API from this app type). That explains why the one on the phone has more APIs available than either of for single app type.
As for LockscreenExtensibility - it's documented, just not available for Jupiter apps:
http://msdn.microsoft.com/en-us/lib...ows.phone.system.lockscreenextensibility.aspx
Click to expand...
Click to collapse
Well that is very good to know! Thanks for the clarification. The best part is that I was actually able to compile without receiving an error (somehow).
I found something that may be of use in order to get the LockscreenExtensibility working (I just tried on a Silverlight 8.1 app and got access denied).
<Capability Name= "ID_CAP_SHELL_DEVICE_LOCK_UI_API"/> <----. Can't be used OOTB
EDIT: I just tested this in the Emulator and it really IS the capability that the LockscreenExtensibility needs in order for it to work.
snickler said:
I found something that may be of use in order to get the LockscreenExtensibility working (I just tried on a Silverlight 8.1 app and got access denied).
<Capability Name= "ID_CAP_SHELL_DEVICE_LOCK_UI_API"/> <----. Can't be used OOTB
EDIT: I just tested this in the Emulator and it really IS the capability that the LockscreenExtensibility needs in order for it to work.
Click to expand...
Click to collapse
I assume this is the thing Rudy Hyun used to create the lockscreen app at Build?
TheInterframe said:
I assume this is the thing Rudy Hyun used to create the lockscreen app at Build?
Click to expand...
Click to collapse
I speculate that this is what he's using. I bet there's more going on that we have yet to figure out. It also could be that the base class EXISTS, but the full implementation isn't available yet. Who knows.
snickler said:
I speculate that this is what he's using. I bet there's more going on that we have yet to figure out. It also could be that the base class EXISTS, but the full implementation isn't available yet. Who knows.
Click to expand...
Click to collapse
Ah, Yes that makes sense. I wonder if there are any other "half-baked" API's in the SDK?
Edit: I Know it sounds stupid but honestly I think we should have a thread dedicated to finding odd API's (Just found one: Windows.Phone.System.SystemProtection, nothing terribly useful though)
TheInterframe said:
Ah, Yes that makes sense. I wonder if there are any other "half-baked" API's in the SDK?
Edit: I Know it sounds stupid but honestly I think we should have a thread dedicated to finding odd API's (Just found one: Windows.Phone.System.SystemProtection, nothing terribly useful though)
Click to expand...
Click to collapse
there are also some hidden APIs in the current SDK for 3D Touch-enabled Apps!
From WP Central:
Some of the features include APIs for gestures, side interactions and even heat maps.
Crazy stuff.
Believe it or not, some of these APIs for developers are in the current SDK, they're just not visible. What this mean though is developers will have access to this 3D Touch technology for their apps. It also means that Microsoft will have a small batch of third-party apps supporting this 3D Touch technology on launch day.
Click to expand...
Click to collapse
source: http://www.wpcentral.com/microsofts-next-flagship-windows-phone-november-3d-touch
Yea, even though those 3D touch APIs may be available, they're not particularly useful, as they require special hardware to work.
Sunius1 said:
Yea, even though those 3D touch APIs may be available, they're not particularly useful, as they require special hardware to work.
Click to expand...
Click to collapse
That is true. Sort of of a side question though, has anyone made a OEM account and looked over the API documentation there? There maybe some useful things we could learn about WP and maybe further a jailbreak for all WP devices....
TheInterframe said:
That is true. Sort of of a side question though, has anyone made a OEM account and looked over the API documentation there? There maybe some useful things we could learn about WP and maybe further a jailbreak for all WP devices....
Click to expand...
Click to collapse
API isn't much useful as long as you cant really use most of functions due to policies.
ultrashot said:
API isn't much useful as long as you cant really use most of functions due to policies.
Click to expand...
Click to collapse
Ah, Yes that makes sense....
http://www.wpcentral.com/joe-belfiore-announces-new-updates-sheds-details-lock-screen-app
Sounds like there will be a dev preview update to enable lockscreen functionality quite soon. Joe also mentioned keeping the lock screen in memory. So 512 MB devices won't get the functionality soon....
Good stuff. Another question: can apps show the action center? Because I want code an app to show notifications on lockscreen. Thanks
Marocco2 said:
Good stuff. Another question: can apps show the action center? Because I want code an app to show notifications on lockscreen. Thanks
Click to expand...
Click to collapse
something to force the volume/music control on the lock screen to automatically open would be really useful as well
Updated first post with some more data since the Live Lockscreen App debuted yesterday. There's more I didn't get into, but I want others to dig in and find out
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Sunius1 said:
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Click to expand...
Click to collapse
I don't think its that but most likely the fact that the API is un-optimized, some of the facts you stated (i.e. Slow start up, documentation is lacking) etc... The fact the OS needs to be updated to show a section telling the user what lock screen app has taken over (since the setting page doesn't now)
Edit: Remember what Joe said about keeping the lockscreen in memory and 512MB devices might not be supported for that reason? Yeah seems like they aren't doing that since you can see the resume time for the lo screen is wayyy to much
Sunius1 said:
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Click to expand...
Click to collapse
You are correct. Two projects: One is the settings page, which is the main entrypoint of the app when it's opened from the start menu and the second one is the actual lockscreen app.
The settings page uses the ExtensibilityApp APIs to register the second one as a lock screen application. That second application is another 8.1 Silverlight app that uses a LockScreen_Bridge WinRT component that has native access to read what is shown on the lockscreen from the WP Settings item.
It then uses some storyboards to make it do different things as you're swiping up and down on the LayoutRoot grid. It does use a timer so that's where that little lag comes from.
The only background stuff it's doing is latching on to system events ("Start button being touched for example").
I can see where MS would be protective of this. They DID say that they would be releasing a public version of the API at some point. I'm hoping it's not one of the situations that leaves it public only when they've approved you to be able to use it.
It does suck that it's restricted to 8.1 Silverlight though. I could see some Music Apps wanting to take advantage of the lockscreen like this.
snickler said:
You are correct. Two projects: One is the settings page, which is the main entrypoint of the app when it's opened from the start menu and the second one is the actual lockscreen app.
The settings page uses the ExtensibilityApp APIs to register the second one as a lock screen application. That second application is another 8.1 Silverlight app that uses a LockScreen_Bridge WinRT component that has native access to read what is shown on the lockscreen from the WP Settings item.
It then uses some storyboards to make it do different things as you're swiping up and down on the LayoutRoot grid. It does use a timer so that's where that little lag comes from.
The only background stuff it's doing is latching on to system events ("Start button being touched for example").
I can see where MS would be protective of this. They DID say that they would be releasing a public version of the API at some point. I'm hoping it's not one of the situations that leaves it public only when they've approved you to be able to use it.
It does suck that it's restricted to 8.1 Silverlight though. I could see some Music Apps wanting to take advantage of the lockscreen like this.
Click to expand...
Click to collapse
Quite interesting...!
The API in itself is quite powerful, custom lockscreens with weather animations are possible! http://wmpoweruser.com/wp8-1-live-l...amazing-lock-screen-weather-animations-video/

Categories

Resources