maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Aliendalvik Control - Useful multitool! (https://talk.maemo.org/showthread.php?t=96334)

coderus 2016-01-09 09:52

Aliendalvik Control - Useful multitool!
 
Please read following description carefully before asking any questions.

Have settings applet with simple GUI actions:
  • Reset HTTP(S) default application in android
  • Show/Hide android navigation bar
  • Open android Downloads application
  • Select android keyboard (you can use Google Keyboard or any other in aliendalvik)

Useful utility for sending commands to aliendalvik. It creates dbus service (on session bus) org.coderus.aliendalvikcontrols with following methods:
  • sendKeyevent(int code): sending input events to android
  • sendInput(QString text): sending text input data to android
  • broadcastIntent(QString intent): invoking am broadcast -a intent command on android
  • startIntent(QString intent): invoking am start intent.split(" ") command on android
  • uriActivity(QString uri): sending uri VIEW intent to android
  • uriActivitySelector(QString uri): sending uri VIEW intent with chooser to android
  • shareText(QString text): opening android sharing menu for text/* data
  • shareFile(QString file, QString mimetype): opening android share menu for file by mimetype
  • hideNavBar(): hiding bottom android navigation bar
  • showNavBar(): showing bottom android navigation bar
  • getFocusedApp(): returns package name of topmost android app at this moment
  • isTopmostAndroid(): returns is android a topmost, or native sailfish ones

Application now automatically modifying android desktop files to make it accept parameters.
You can use latest version of Mimer to assign default web browser directly to selected android apps.

Package installs sharing plugin and replaces old Android ShareUI plugin.

Package also installs android-open-url.desktop and androd-open-url-selector.desktop files invoking uriActivity and uriActivitySelector methods which can be set (manually, via xdg-mime tool) to various mimetypes.

Post your improvement ideas in this thread.
Openrepos: https://openrepos.net/content/coderu...dalvik-control
GitHub: https://github.com/CODeRUS/aliendalvik-control

coderus 2016-01-09 10:04

Re: Aliendalvik Control - Set android browser as default
 
Settings mimehandler manually:
Code:

ln -sf /home/nemo/.local/share/applications/mimeapps.list /home/nemo/.local/share/applications/defaults.list
<- only once, to make things actually works. Then:
Code:

xdg-mime default android-open-url.desktop x-maemo-urischeme/http
xdg-mime default android-open-url.desktop x-maemo-urischeme/https

Searching activity name for other browser:
Open application desktop file. For example chrome desktop file /usr/share/applications/apkd_launcher_com_android_chrome-org_chromium_chrome_browser_document_ChromeLaunche rActivity.desktop and read last part for Exec line.
Chrome activity: com.android.chrome/org.chromium.chrome.browser.document.ChromeLaunche rActivity

coderus 2016-01-09 17:31

Re: Aliendalvik Control - Set android browser as default
 
Nobody interested or nobody figured how to use it?

Ancelad 2016-01-09 19:47

Re: Aliendalvik Control - Set android browser as default
 
I'm interested and I can say - it works!

Van-ess 2016-01-09 20:29

Re: Aliendalvik Control - Set android browser as default
 
I cannot understand the second part of "org.mozilla.firefox/org.mozilla.gecko.BrowserApp" to replace it for Chrome

coderus 2016-01-09 20:39

Re: Aliendalvik Control - Set android browser as default
 
open chrome desktop /usr/share/applications/apkd_launcher_com_android_chrome-org_chromium_chrome_browser_document_ChromeLaunche rActivity.desktop or other browser desktop. Last part of Exec line is activity you search for. For Chrome it's com.android.chrome/org.chromium.chrome.browser.document.ChromeLaunche rActivity

Added information in description :)

Van-ess 2016-01-09 21:11

Re: Aliendalvik Control - Set android browser as default
 
Ok, got it. Now I have
Code:

cat /home/nemo/.config/aliendalvikcontrol/mimehandlers/Chrome
com.android.chrome/org.chromium.chrome.browser.document.ChromeLauncherActivity

But I don't have /usr/share/applications/url-handler-Chrome.desktop or any similar file
Code:

ls /usr/share/applications/ | grep url
android-open-url.desktop
android-open-url-selector.desktop
jolla-messages-openurl.desktop
open-url.desktop
voicecall-ui-openurl.desktop

What should I do next?

coderus 2016-01-09 21:13

Re: Aliendalvik Control - Set android browser as default
 
start aliendalvik-control from terminal or invoke any dbus command of it to start it in background

corvinux 2016-01-10 12:44

Re: Aliendalvik Control - Set android browser as default
 
@coderus I can see your PoC would have same useful application for example to intercept SMS from Sailfishos and pass it to dalvik which we need for registration in app Signal. Can you look into it?
Tnx.

coderus 2016-01-10 13:14

Re: Aliendalvik Control - Set android browser as default
 
I dont think it's possible using intents.


All times are GMT. The time now is 20:28.

vBulletin® Version 3.8.8