chengxinlun / Stellarium-android

A version of Stellarium for android
GNU General Public License v2.0
84 stars 28 forks source link

Allow use config files & data sets placed outside from root folder #2

Open ghost opened 7 years ago

ghost commented 7 years ago

While there no yet plugin interface for "Stellarium for Android" it would be good if user could manualy edit config files (in text editor) and place data sets (using file manager) on internal storage or on SDcard.

Would be usefull on non-root'ed devices.

chengxinlun commented 7 years ago

Yes, you are right. Gonna implement it soon.

chengxinlun commented 7 years ago

https://github.com/chengxinlun/Stellarium-android/commit/25c32e5568908019eb9d0c1001dd774b758b8214b This should do it. The custom user directory is under /sdcard/stellarium/. The directory structure should remain the same with the original user directory. It has higher priority than the original one.

chengxinlun commented 7 years ago

Please note that if you are using Android 6.0+, you need to manually allow stellarium to access storage in your phone's setting. Qt has not yet published an API for the new Android permission system.

ghost commented 7 years ago

Please note that if you are using Android 6.0+, you need to manually allow stellarium to access storage in your phone's setting. Qt has not yet published an API for the new Android permission system.

Its not a problem, but is it possible add ask dialog for read/write files on first application start? (as it work now for ask geopositioning dialog)

Anyway, its COOL! ;-)

chengxinlun commented 7 years ago

It is possible but it needs some JNI techniques since Qt currently does not provide API for asking storage read/write permission. Will look into it.

ghost commented 6 years ago

@chengxinlun, Now I try test this feature:

  1. Install Stellarium-API23-1.24.3.apk;
  2. Give permission for "Read/Write Data";
  3. Goto /sdcard/stellarium/ (autogenerated)
  4. Create folder /sdcard/stellarium/data/;
  5. Put custom satellites.json data file to /sdcard/stellarium/data/;
  6. Restart Stellarium and test search added sattelites;
  7. Stellarium still use distributed (inbuilt) ../data/satellites.json, and NOT USE custom /sdcard/stellarium/data/satellites.json!

What is wrong here?

chengxinlun commented 6 years ago

Put satellites.json```` under/sdcard/stellarium/modules/Satellites```. It should work nicely, though I have not tested yet.

BTW, permission request has been fixed. The app should request for permission during its first run.

ghost commented 6 years ago

BTW, permission request has been fixed. The app should request for permission during its first run.

@chengxinlun, it's look like now app request permission for access to filesystem every time when I run it.

I can dissable request permission for geolocation using checkbox "Not ask me anymore", but CAN'T dissable request permission for access to filesystem and it requested on each app launch.

Android vetsion: 6.0

Application version: 1.24.4