[Sample App] Build your own Home Screen

1,315 views
Skip to first unread message

Dave Smart

unread,
Apr 30, 2016, 5:40:04 AM4/30/16
to DroidScript
Hi Guys,

I know some of you are desperate to have a go at creating your own Android home screen and launcher... well now you can :)

Make sure you have the latest version of DroidScript and try the attached sample script.  You will need the APKBuilder to install this demo as a home screen on your device, but you can still test it without the APKBuilder.

To revert to your normal home screen, you need to go to the Android Settings / More / Default Applications menu.

This sample is just a very basic home screen and launcher, however it could be extended and improved a great deal by sending intents and adding extra functionality with the new plugin generator.

Note: Building your app as a home screen is also very useful for forcing your application to be the only user choice at startup. This is particularly useful when building user interfaces for home automation controllers, kiosks or control panels for industrial equipment.

Regards
David
Launcher.js

Android Team Inc.

unread,
Apr 30, 2016, 5:45:45 AM4/30/16
to DroidScript
OMG! Dave ur the BEST! <3

Manuel Lopes

unread,
Apr 30, 2016, 9:11:39 AM4/30/16
to DroidScript
thanks dave

Bradley Matusiak

unread,
May 2, 2016, 3:43:51 PM5/2/16
to DroidScript
anyway to hide system bars, like "getWindow().getDecorView().setSystemUiVisibility(View.GONE);"?

Dave Smart

unread,
May 3, 2016, 3:25:11 AM5/3/16
to DroidScript
app.SetScreenMode( "Game" )

or 

app.SetScreenMode( "Full" )

xxnikocarlgtaxx

unread,
May 11, 2016, 9:48:30 AM5/11/16
to DroidScript
Ey Dave ¿Can you write  all options? DisplayIcons( scroller (AND?...) ); :) Thanks

Steve Garman

unread,
May 11, 2016, 11:19:29 AM5/11/16
to DroidScript
DisplayIcons is a function in the code.

If you look at the function, you will see it requires just one argument.

That argument is a layout to place the icons on.

function DisplayIcons( lay )

Bill DeWitt

unread,
May 15, 2016, 6:14:13 PM5/15/16
to DroidScript
Great! one of my main reasons for using Droidscript was in hopes of making default single purpose home screens for my old devices. 

Bradley Matusiak

unread,
May 19, 2016, 9:00:16 AM5/19/16
to DroidScript

I tried this.. it seem to leave a bar on the bottom.



Manuel Lopes

unread,
May 19, 2016, 9:05:58 AM5/19/16
to DroidScript
is a black bar same bug with fullscreen i ask

Bradley Matusiak

unread,
May 19, 2016, 9:22:33 AM5/19/16
to DroidScript
Yup, your sure did. I  just wanted to upload a picture to confirm exactly what i'm seeing. in this thread for the reply i recieved

RuslanX

unread,
May 20, 2016, 11:16:47 AM5/20/16
to DroidScript

Chris G Larcombe

unread,
May 22, 2016, 6:50:52 AM5/22/16
to DroidScript
Hi there!

I just compiled Launcher.js to an APK and installed it, but it didn't show up as a 'home app' (launcher) in the list in settings, so I couldn't set it as the default home app (assign it to the home button)....  (I also tried a 3rd party app to change the home app but it didn't appear in this either).

I only see "TouchWiz easy home" and "TouchWiz home" in the list under 'Change home' in 'Default Applications' option.

Is there something I'm missing (another set involved), other than installing the APK before it appears in this menu?

Version of Android is 4.4.2. 

Thank youuu! x



Chris G Larcombe

unread,
May 22, 2016, 7:05:40 AM5/22/16
to DroidScript
Okay, got it, 

I created build.json in same directory as Launcher.js (app root directory),

Containing the following data:

{
    "manifest" : 
    { 
        "minSdkVersion" : 8,
        "targetSdkVersion" : 16,
        "debuggable" : false,
        "homeScreen":true,
    }
}

(I noticed the comment at the top of the code in the end!)

Chris G Larcombe

unread,
May 22, 2016, 7:07:15 AM5/22/16
to DroidScript
One observation:

My phone required a reboot before the back button would go back/close button would go back to the launcher. Home button opened the launcher straight away but the back button still closed the launcher (and it went back to touchwiz) until I rebooted... now the back button also opens the launcher.

Might want to recommend a reboot to people after they change their launcher.

Cheers,

Chris. 

Chris G Larcombe

unread,
May 22, 2016, 7:08:11 AM5/22/16
to DroidScript

My phone required a reboot before the back/close button would open the launcher. Home button opened the launcher straight away but the back button still closed the launcher (and it went back to touchwiz) until I rebooted... now the back button also opens the launcher.

:) 


Android Team Inc.

unread,
May 22, 2016, 7:09:11 AM5/22/16
to DroidScript
Yes you've did it well though, but keep in mind that the Launcher app only works when you've installed it as an APK file.

Android Team Inc.

unread,
May 22, 2016, 7:11:09 AM5/22/16
to DroidScript
And on some devices the app can cause bugs after installing new apps. (You are probaly not able to open the Google Play Store though).

catt...@gmail.com

unread,
Jun 10, 2016, 4:34:56 PM6/10/16
to DroidScript
I have been running this sample on my LG G4 from within DroidScript.
No errors. But when I make the APK and run it, this error appears:
"Script Error: app.GetActivities is not a function". No idea why.

Steve Garman

unread,
Jun 10, 2016, 4:39:28 PM6/10/16
to DroidScript
My guess is you did not follow the big red instructions in the release notes for version 1.34 https://groups.google.com/d/msg/androidscript/7ModQQYdJa4/TV9hKZwnBAAJ

catt...@gmail.com

unread,
Jun 10, 2016, 5:03:12 PM6/10/16
to DroidScript
I was running 1.34 and reinstalled APK, no change ... then tried non-debug build.
It works! Still cannot get it to run as home screen but will keep trying.

Steve Garman

unread,
Jun 11, 2016, 3:10:38 AM6/11/16
to DroidScript
cattycom,
have you added build.json as described by Chris G Larcome above?
https://groups.google.com/d/msg/androidscript/WFxTBLfYNRw/FonUWtBoFwAJ

Luckyleo Apps

unread,
Jun 13, 2016, 9:50:58 AM6/13/16
to DroidScript
Hey, I created the build.json file with everything in it, but on my Samsung Galaxy S5 mini it doesn't seem to work. What is wrong? I have android 5.1

Thanks!

Steve Garman

unread,
Jun 13, 2016, 9:58:50 AM6/13/16
to DroidScript
What happens when it "doesn't seem to work?"

Have you run the apk?
Did the app seem to run then?

Have you rebooted the device?
Did the apk start automatically when the device rebooted?

catt...@gmail.com

unread,
Jun 14, 2016, 9:05:14 PM6/14/16
to DroidScript
I think the json file quoted above is somehow incomplete.
Still can't get it to work as a home app but is good as just a launcher.
Might be something incompatible with my android version: 6.0

catt...@gmail.com

unread,
Jun 21, 2016, 3:44:24 PM6/21/16
to DroidScript
Finally got the APK to work, I just added a line at the bottom of the build.json file:

{
    "manifest" : 
    { 
        "minSdkVersion"    : 8,
        "targetSdkVersion" : 16,
        "debuggable"       : false,
        "homeScreen"       : true,
        "pathPattern"      : ".*\\.txt"
    }
}

Emma Nevada

unread,
Aug 14, 2016, 6:56:32 AM8/14/16
to DroidScript
with a little modification i think you can also turn it into a lock screen :D i have downloaded Pin Genie, and its like a default homescreen until you unlock it, making it a lockscreen, and this there quite interests me, and up until i saw this thread I was wondering exactly how to do such a thing in DS, thank you :D

Alex F

unread,
Aug 20, 2016, 11:45:50 AM8/20/16
to DroidScript
I modified it a bit. Use longtouch and info and the intent will be copied to the clipboard. Useful if you want to make intents
launcher.js
Reply all
Reply to author
Forward
0 new messages