Applist icon indicating copy to clipboard operation
Applist copied to clipboard

Image does not exist in this directory

Open Ogaiht10 opened this issue 8 years ago • 13 comments

I got the apps list, but there were two problems: the icon of apps does not exist in this directory and Google Maps was not included in the list.

On the way the image noticed the name "ionic" but I do not use ionic use the "Visual Studio Cordova".

Can someone help me? I need to get the icons of apps.

Ogaiht10 avatar Sep 29 '16 19:09 Ogaiht10

Hey,

Have you looked in your device's sd card directory: sdcardd//com.ionicframework.xxx/Cache/ ?

Let me know if you find them there. This only gives you the user installed apps, not the system default apps. Do you want to contribute and create a flag for it? (I can tell you where and how!)

jmrezayi2 avatar Sep 29 '16 19:09 jmrezayi2

Already I looked this directory does not exist. I do not have memory card on the phone

Ogaiht10 avatar Sep 29 '16 21:09 Ogaiht10

Do you have a file manager app and can see external storage? (with path /storage/emulated/0" or something like that)

jmrezayi2 avatar Sep 30 '16 12:09 jmrezayi2

yes, there is a directory "/storage/emulated/" but does not have any files

Ogaiht10 avatar Sep 30 '16 13:09 Ogaiht10

No files at all or no "com.ionicframework.xxx/Cache/"?

jmrezayi2 avatar Sep 30 '16 15:09 jmrezayi2

this directory does not exist: "com.ionicframework.xxx"

Ogaiht10 avatar Sep 30 '16 15:09 Ogaiht10

I see.. I might need some logs to see what is the error.. Can you send me the cat logs from your device? Also, try creating the directories, and see if it can place images in or not.

jmrezayi2 avatar Sep 30 '16 15:09 jmrezayi2

I don't think an app has permission to write sdcard after android 5.0 and later. Apps may write to

/storage/emulated/0/Android/data/com.company.app_id

PS: com.company.app_id is application's app id such as com.facebook.katana

coolman7 avatar Feb 20 '17 14:02 coolman7

Awesome comment! Then we just need to change lines 103 - 105 to get applications directory instead. Would you be able to give it a quick try?

jmrezayi2 avatar Feb 22 '17 19:02 jmrezayi2

I've changed three lines (103, 105 and 121) manually. It did not create directory. But it was created it worked. I installed file plugin. File plugin created the directory. So my problem partially solved. But this plugin should replace com.ionicframework.xxx with app_id automatically and should create directory itself, without need of file plugin.

coolman7 avatar Feb 24 '17 06:02 coolman7

I have created a pull request for this purpose. https://github.com/jmrezayi2/Applist/pull/7

I don't know android java programming. This is probably not working. So you should correct this code: String app_id=context.getPackageName();

coolman7 avatar Feb 26 '17 13:02 coolman7

How ionic3 calls to get the installed app list ? (<any>window).Applist.createEvent('', '', '', '', '', (app_list)=>{ alert(JSON.stringify(app_list)); console.log(JSON.stringify(app_list)); }, (app_list)=>{ alert("Oopsie! " + app_list); console.log("Oopsie! " + app_list); }); error: TypeError: Cannot read property 'createEvent' of undefined (<any>window).Applist.Applist.createEvent('', '', '', '', '', (app_list)=>{ alert(JSON.stringify(app_list)); console.log(JSON.stringify(app_list)); }, (app_list)=>{ alert("Oopsie! " + app_list); console.log("Oopsie! " + app_list); }); error: TypeError: Cannot read property 'Applist' of undefined

CjoyHome avatar Mar 13 '18 09:03 CjoyHome

Based on the comments of @coolman7. I have updated the path. So I am able to get the path of the package name.

But now I am getting this error at saving the file, like this java.io.FileNotFoundException: /data/io.ionic.starter/cache/sun.way2sms.hyd.com.png (No such file or directory)

Is there any solution for this?

HardikDG avatar May 27 '20 03:05 HardikDG