(These may be adapted to your needs.)
- Clean environment yet without any dart, flutter or android studio
- FlutterRoot: c:\
- FlutterDir: $(FlutterRoot)\flutter
- AndroidStudioRoot: c:\
- AndroidStudioDir: $(AndroidStudioRoot)\AndroidStudio
- RSMobileDir: c:\RS-Mobile
- RSPlatformTools: C:\Users\LOCALWINUSERNAME\AppData\Local\Android\Sdk\platform-tools
- Download and install any flafour of git for windows. (see: https://flutter.dev/docs/get-started/install/windows#system-requirements)
- Download Flutte stabler: https://flutter.dev/docs/get-started/install/windows#get-the-flutter-sdk
- Open the zip-package and copy the contained flutter-Dir to FlutterRoot. This results in the FlutterDir.
- Add in environment variables for your account to the PATH-variable of USER context separated by ';' the explicit full path to flutter\bin: $(FlutterDir)\bin
- Test:
Start a cmd console (in START/RUN type: cmd) - type: flutter -h '
fluuter should show you its help text if all is well until now.
- Test:
- in cmd type: flutter doctor
- flutter chechs its environment and will most likely tell you, that
- Android SDK is missing
- Android Studio is missing
- it may also query for chrome but this is not needed
- flutter chechs its environment and will most likely tell you, that
- install Android Studio for windows: https://developer.android.com/studio
- follow the default setting and ensure the installation is done to AndroidStudioDir
- After installation start Android Studio and let it update if it queries for some
- press NEXT-buttons until it is no longer shown
- press FINISH and folloow until finish
- On Wellcome-Page go into plugins and
- install dart and flutter and let AS restart
- On Welcome page select projects: More Action/SDK Manager and than Tab SDK-Tools.
- Ensure alls "Android SDK"* Entries are installed and especially
- ensure "Android SDK command line tools" to be installed
- Close the SDK Dialog
- If you wish to use simulated mobiles you may later select in "more actions" AVD Manager and create emulated devices as you need.
- tell Flutter wher to find AS:
in cmd console type:
flutter config --android-studio-dir "$(AndroidStudioDir)".
The quotes are mandatory if the path conataisn for exc. BLANKs - now you need to acceps the sdk licenses:
in md type:
flutter doctor --android-licenses
and accept all.
- In new cmd-console type:
flutter doctor
it should now tell all (but maybe chrome) is OK.
RS-mobile depends on the following packages to be avail on path-level parallel to RS-mobile itself and with a name actually not matching the their repo names: {as of rs-mobile: SHA-1: 8a16a84711388872d455ce2a81dbfe4f8643f63f}
- Repo: https://gitlab.com/Kumaravinash9/retroshare-dart-see.git
- clone it to the same folder-hierarchy level as you will do for rs-mobile
- ensure the folder is named "retroshare-dart-see" as actual awaited in pubspec.yaml of rs-mobile
- call by cmd-console in this path: flutter pub get.
- Repo: https://github.com/Kumaravinash9/Retroshare-Wrapper.git
- clone it to the same folder-hierarchy level as you will do for rs-mobile
- ensure the folder is named different to the repo name as "retroshare_api_wrapper" as actual awaited in pubspec.yaml of rs-mobile
- call for exc. by cmd-console in this path: flutter pub get.
- Git: clone RS mobile locally as RSMobileDir
(https://github.com/RetroShare/retroshare-mobile) - Open a cmd window (type cmd in START)
- change directory into RS mobile dir
- type:
flutter pub get to update the flutter package dependancies as need in the project. - open the RSMobileDir in Android Studio
- Within the opened Android Studio on the left side in the Project-Tab open the path:
"retroshare-mobile/android/app/src/main/java/io/GeneratedPluginRegistrant.java" - Start "GeneratedPluginRegistrant.java" by dobbleclick on it.
- On the rightside on top of the opened registrant:
if you see a note "Module SDK is not defined",
than click the button "Setup SDK" on the right side of this note. - In the opened dialog select any android SDK and click OK.
- Restart Android Studio.
Now your project - this is to do in any new project - is able to define and use emulated Phones.
- in settings type usb in search
- select usb-debugging
- activate it
- plug the mobile with usb to the pc
- if this is the frist time a dialog appears to accepts the key
- check in cmd console if the device is available
- cmd: flutter devices should no list your mobile as availabel
- plug in the USB of the phone
- activate: USB-usage file transfer
- load the service apk to the mobile and install it
- For your convenience:
Add in environment variables for your account to the PATH-variable of USER context separated by ';' the explicit full path to the command_tools: $(RSPlatformTools) where the adb.exe houses which we will need. - Open a cmd-console within the directory of your service apk
- type in cmd:
adb install "YOUR_SERVCIE_APK.apk"
type in cmd console:
flutter run [[--release]]
without release it gets run in debug mode
RS- Mobile is debugale simpy with Android-Studio as usual with. Just intuitiv and relative conmfortabel.
Open a cmd-console in the directory of the android ../sdk/patform-tools. There you will find the adb.exe (Android Debug Bridge). This tool enables you for excample to get the tracefiles from your android-device by adb logcat > trace.txt
You may filter the content of trace.txt than by "restroshare" to get only the lines of the clinet and the service without other andoris contextual activities.
TBD; actual not knwon how to setup a debug-environment fort it.
Hints in context: https://gitlab.com/elRepo.io/elRepo.io-android/-/issues/43
As above with the adb.exe tool. If you want manually check the communicatio interface of the servcice
you may use the cUrl tool.
To use it you must redirect establich a redirection of the ports:
adb forward tcp:9091 tcp:9092
than you should be able to talk to the servcie direcly.
for exc. like:
curl http://127.0.0.1:9091/RsJsonApi/version -v
This would for exc generate an output like
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 9091 (#0)
> GET /RsJsonApi/version HTTP/1.1
> Host: 127.0.0.1:9091
> User-Agent: curl/7.55.1
> Accept: /
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Content-Length,Content-Range
< Connection: close
< Content-Length: 116
< Content-Type: application/json
<
{
"major": 0,
"minor": 6,
"mini": 6,
"extra": "-38-g25f58bc10",
"human": "0.6.6-38-g25f58bc10"
}* Closing connection 0