Shortcut files show blank

133 views
Skip to first unread message

Soni Kumari

unread,
Jul 13, 2026, 12:28:33 PMJul 13
to DroidScript
Why shortcuts app.CreateShortcut() doesn't work for html file? 
It is work on ide but when i build my apk it will show blank after creating shortcuts when i open the shortcuts 


Any way to fix it please?

Thanks regards 
Soni!

Dave

unread,
Jul 14, 2026, 6:34:26 AMJul 14
to DroidScript
You are probably using an invalid icon file path.  Icon paths should be relative to your code folder.

Show us a snippet of your code and we might be able to spot the issue for you.

Message has been deleted
Message has been deleted

Soni Kumari

unread,
Jul 14, 2026, 6:54:39 AMJul 14
to DroidScript
function OnStart()
{
   
    app.CreateShortcut( "Demgvo", "Img/App Demo.png","j.html" );
    app.ShowPopup( "Add Shortcut" );
    
    
}

And j.html is also added in file 

Dave

unread,
Jul 14, 2026, 7:20:42 AMJul 14
to DroidScript
APKs are case sensitive, make sure you are using the correct case for the png file name.

Also, you could try replacing the space with an underscore as it's possible Android does not like spaces in shortcut icon paths.

Soni Kumari

unread,
Jul 14, 2026, 7:28:03 AMJul 14
to DroidScript
Thanks dave! 
But still it is not not working after apk build 
It is work on ide but not own apk 

Is the any demo code as spk?

Dave

unread,
Jul 14, 2026, 9:12:44 AMJul 14
to DroidScript
Did you try removing the space from the png file so it's just "AppDemo.png" ?

Dave

unread,
Jul 14, 2026, 9:15:25 AMJul 14
to DroidScript
Also, you might need to put _AddPermissions( "Shortcut" ) in your main html file if you are adding the shortcut from a file in a sub-folder of the project

Soni Kumari

unread,
Jul 14, 2026, 1:48:38 PMJul 14
to DroidScript
I did everything but i don't know why it isn't working 😔 

Dave

unread,
Jul 15, 2026, 8:20:35 AMJul 15
to DroidScript
I think some phone models have a special permission setting "Allow Shortcut Creation" or similar and need manual approval.  Check in your settings.

What device do you have and what version of Android is it?

Soni Kumari

unread,
Jul 15, 2026, 8:26:32 AMJul 15
to DroidScript
IQOO z10x 
Android 16

If you can share spk i would really appreciate, it might be, I'm making mistakes 

Dave

unread,
Aug 31, 2026, 6:08:07 AM (6 days ago) Aug 31
to DroidScript
I think this issue might be fixed in 2.80

Just to clarify - did the shortcut get created and the shortcut icon look ok? 

Was the black screen showing only after clicking the shortcut?

Alan Hendry

unread,
Aug 31, 2026, 6:54:02 AM (6 days ago) Aug 31
to DroidScript
HI,
Droidscript.js has
else if( item==T("CreateShortcut") )
{
var file = appPath+"/"+curProgram+"/"+curProgram+".js";
var iconFile = appPath+"/"+curProgram+"/Img/"+curProgram+".png";
if( !app.FileExists( iconFile ) ) iconFile = "/assets/Img/Icon.png";
Which implies the icon should be one of those two paths
And
if( src.indexOf("app.CreateShortcut") > -1 ) AddPermission("Shortcut");
So it might be worth trying _AddPermission
On Android 15 it adds the shortcut, 
and touching the icon on Android Home works
Regards, ah

function OnStart() {
lay = app.CreateLayout( "Linear", "VCenter,FillXY" )
txt = app.AddText(lay,"app.GetNavBarHeight() "+app.GetNavBarHeight())
txt = app.AddText(lay,"app.HasSoftNav() "+app.HasSoftNav())
txt = app.AddText(lay,"app.IsNavBarOnRight() " +app.IsNavBarOnRight())
// txt = app.AddText(lay,"app.HasNavBar() ",app.HasNavBar())
app.AddLayout( lay )
  var file = app.GetAppPath() + "/" + app.GetAppName() + ".js";
  app.CreateShortcut( "Demo", "/Sys/Img/Icon.png", file );
}

Alan Hendry

unread,
Aug 31, 2026, 7:06:52 AM (6 days ago) Aug 31
to DroidScript
P.S. It all works under DS,
but built as APK, it adds the shortcut,
but touching it shows me the icon (large).
In my case file resolves as
/sdcard/DroidScript/atest/atest.js
Regards, ah

Soni Kumari

unread,
Aug 31, 2026, 7:36:54 AM (6 days ago) Aug 31
to DroidScript
Yes the shortcuts was created successfully and icon as well, but when click on it it shows blank screen and sometimes crashed 

Alan Hendry

unread,
Aug 31, 2026, 12:39:50 PM (6 days ago) Aug 31
to DroidScript
Hmm,
APK is installed correctly in list of all apps as atest
Running it resolves file as 
/android_asset/user/atest.js
It adds a shortcut to the home page with the icon and name demo
But running it just shows the icon (large)
So I think the question is "what should file be"?
Regards, ah
1000012597.jpg


Dave

unread,
Sep 1, 2026, 4:48:45 PM (5 days ago) Sep 1
to DroidScript
Try this latest release - https://droidscript.org/download/v2.80/
Reply all
Reply to author
Forward
0 new messages