swiftp icon indicating copy to clipboard operation
swiftp copied to clipboard

can not run in android 8.0 on pixel mobile

Open tuzhao opened this issue 6 years ago • 7 comments

I am running this app on pixel mobile,but can't run normally. here is resolve solution: Intent intent = new Intent(FsService.ACTION_STOP_FTPSERVER); intent.setPackage(getActivity().getPackageName()); getActivity().sendBroadcast(intent); should add setPackage of every send broadcast Intent.

tuzhao avatar Aug 09 '17 07:08 tuzhao

Thanks to report. I don't have 8 on my device yet, so this is good to get a heads up! I'd like to know why this is needed.

Do you have multiple versions of swiftp installed? (demo/free/paid - release/debug)

ppareit avatar Aug 09 '17 09:08 ppareit

new safety rules for android o? i had cloned your git repo and created a repo named RsFTP and under GPL3 license. here is link: https://github.com/tuzhao/rsftp .

tuzhao avatar Aug 09 '17 09:08 tuzhao

Reading up on this, I believe broadcasts are indeed much more limited in android O: https://developer.android.com/preview/features/background.html#broadcasts

It would be nice if you could fork the repo instead of cloning. One of your nice changes, the welcome and exit code additions, will now be much harder to be tracked or picked up. It would also allow you to keep your project more in sync with swiftp. https://help.github.com/articles/fork-a-repo/

ppareit avatar Aug 09 '17 11:08 ppareit

ok,I had forked.

tuzhao avatar Aug 10 '17 01:08 tuzhao

Indeed, for android O, all usages of sendbroadcast will have to be reworked. This programming pattern makes use of system broadcasts and most could make use of LocalBroadcastManager.

One possible problem will be Tasker integration. The intents
be.ppareit.swiftp.ACTION_START_FTPSERVER be.ppareit.swiftp.ACTION_STOP_FTPSERVER are explicit public to enable scripting.

A good course of action is start using LocalBroadcastManager, keep the above intents public and keep using api 25 (pre android O) for a little while. This will make the code ready for api 26 and above in the future while for now keep the public intents working.

ppareit avatar Aug 10 '17 13:08 ppareit

yeah,you are right. using api 25 makes app run normally. I don't test using LocalBroadcastManager. Anyway,solving problems is our ultimate goal. ha ha...

tuzhao avatar Aug 11 '17 06:08 tuzhao

I'll keep the issue open. While not a problem as long as we keep using api 25, it will eventually become a problem.

ppareit avatar Aug 11 '17 07:08 ppareit