Android Question android.intent.action.MEDIA_BUTTON again...

lemonisdead

Well-Known Member
Licensed User
Hello,

I have made some tests trying to detect a press on the small button included on some wired headsets.

When the activity is not paused, I get the activity keypress with value 79 each time. But when trying to detect it from a service using the code below, the service never starts. I am sorry as I am not still understanding the intent process so perhaps my code is not for this button ?

B4X:
AddReceiverText(MyService, <intent-filter>
    <action android:name="android.intent.action.MEDIA_BUTTON" />
    </intent-filter>)

Many thanks :)
 

Jmu5667

Well-Known Member
Licensed User
Hello,
my sample recieves Media button. I have removed jpg file slusalke2, but i don0t know, what you get error. Here, new sample, but, i i say, i receive proprly when the button on headphones is pressed.


Same errors again, can you remove the unused library reference also

B4X:
LogCat connected to: B4A-Bridge: HTC HTC One X
Installing file.
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
Streams_terminated
sending message to waiting queue (CallSubDelayed - UpdateStatus)
Connected to B4A-Bridge (Wifi)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
Installing file.
PackageAdded: package:tps.stari
Copying updated assets files (1)
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
** Activity (main) Create, isFirst = true **
java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:345)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
   at tps.stari.main._activity_create(main.java:374)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
   at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
   at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
   at tps.stari.main.afterFirstLayout(main.java:102)
   at tps.stari.main.access$000(main.java:17)
   at tps.stari.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:725)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:5751)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
   at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/sdcard0/Android/data/tps.stari/files/virtual_assets/slusalke2.jpg: open failed: ENOENT (No such file or directory)
   at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:92)
   at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:113)
   ... 28 more
Caused by: java.io.FileNotFoundException: /storage/sdcard0/Android/data/tps.stari/files/virtual_assets/slusalke2.jpg: open failed: ENOENT (No such file or directory)
   at libcore.io.IoBridge.open(IoBridge.java:416)
   at java.io.FileInputStream.<init>(FileInputStream.java:78)
   at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:199)
   at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:498)
   at anywheresoftware.b4a.objects.drawable.BitmapDrawable.build(BitmapDrawable.java:69)
   at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:90)
   ... 29 more
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
   at libcore.io.Posix.open(Native Method)
   at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
   at libcore.io.IoBridge.open(IoBridge.java:400)
   ... 34 more
Error occurred on line: 52 (Main)
Error occurred on line: 52 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
   at tps.stari.main._activity_create(main.java:374)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
   at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
   at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
   at tps.stari.main.afterFirstLayout(main.java:102)
   at tps.stari.main.access$000(main.java:17)
   at tps.stari.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:725)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:5751)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
   at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
   at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
   at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:71)
   at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:35)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:406)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
   ... 22 more
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
   at tps.stari.main._activity_create(main.java:374)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
   at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
   at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
   at tps.stari.main.afterFirstLayout(main.java:102)
   at tps.stari.main.access$000(main.java:17)
   at tps.stari.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:725)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:5751)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
   at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
   at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
   at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:71)
   at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:35)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:406)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
   ... 22 more
** Activity (main) Resume **
** Activity (main) Resume **
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Hello,
my sample recieves Media button. I have removed jpg file slusalke2, but i don0t know, what you get error. Here, new sample, but, i i say, i receive proprly when the button on headphones is pressed.


The Slu service does not seem to get called when headphone button is clicked.
 
Upvote 0

stari

Active Member
Licensed User
Hi, i removed all necessery things, so now i'm shure can be Ok.
As i say, this works for me on older Android OS. You can se when the Slu is called in log.
And now i have found another problem. I have 2 headphones, both with media button. With the first headphones all is working Ok, the second headphones button is not detectet.
I get signal "Slusalke priključene" what is the same as "Headphones connected". But if i press the button, nothing hapens.
On the first headphones also the button is detected.
Hm, try .....
 

Attachments

  • PHC.ZIP
    5.4 KB · Views: 225
Upvote 0

lemonisdead

Well-Known Member
Licensed User
With the first headphones all is working Ok, the second headphones button is not detectet.
Thanks Stari and I can confirm that odd behavior I already met (headset provided by the marketer or/and differences between 2 pins and 3 pins Jacks)
 
Upvote 0

stari

Active Member
Licensed User
Thanks Stari and I can confirm that odd behavior I already met (headset provided by the marketer or/and differences between 2 pins and 3 pins Jacks)
Hm, but on my HTC Desire 820 with Android 5.0.2 i can't detect button press, with the same solution.
 
Upvote 0

stari

Active Member
Licensed User
I did some experiments. I instaled iKey from Playstore. I tested program on Android 4.0.3.
With headphones 1 all is working, with second not.
Both headphones have 3 pins + ground.
On Android 5.0.2 - program is not working, exactly like may PHC.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
I did some experiments. I instaled iKey from Playstore. I tested program on Android 4.0.3.
With headphones 1 all is working, with second not.
Both headphones have 3 pins + ground.
On Android 5.0.2 - program is not working, exactly like may PHC.

can you sent me your sample, still not working for me :mad:
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Just to be very clear, I am not receiving the android.intent.action.MEDIA_BUTTON intent. I am testing this on a Sony Experia (4.4.4) and a HTC One X (4.2.2).

I have attached my simple project, could someone else please test with their headphones and let me know what I am doing wrong, this is kind of urgent for me now.
@lemonisdead
@stari
@Erel
 

Attachments

  • headphone.zip
    10.2 KB · Views: 209
Upvote 0

stari

Active Member
Licensed User
Good news: your headphone is working on Android 4.0.3, and bed news: not working on Android 4.4.4. Yes, i call RegisterForMediaButton, but without succes.
On ver. 5.0.2 also nothing, will see what can i doo, but today i don't have time.

Also my solution is working on older Android version.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
I am sorry, does not work for me. Tested with their own headset :
  • Wiko Cink, Android 2.3.6
  • Alcatel Pop C7, Android 4.2.2
  • Thl 5000T, Android 4.4.2
  • Sony D5103, Android 4.4.4
  • Motorola Moto G XT1032, Android 5.1.1
And with a generic headset for all models + Nexus 7 ME370T, Android 5.1.1
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
This is crazy ! there is an app called Keycut, https://play.google.com/store/apps/details?id=com.lennox.keycut, and it works, surely we can get the same results. I have tried everything at this point. I need to get this working, I am willing to pay someone to solve this. The keycut app works on both my devices. I don't understand this ! Can everyone try the keycut app on there devices please.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Yes it does work and Yes it is crazy (in fact the reason why I long time ago asked if a Java dev had more power than a b4a one)...
Manfred had provided the way to open the app's manifest (page 1 of this thread).
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
@Jmu5667 : After having installed KeyCut, ran it, uninstalled it, your app got the intent (I have seen the toasts by chance)
I have uninstalled your app and recompiled it. It didn't got any intent anymore.
I have reinstalled KeyCut, ran it, uninstalled it again. Again, your app got the intent

Edit : remade the same test without starting KeyCut (only installing it from Play Store) while your app was already installed : it got the intent immediately


Following to the previous message I continued my tests :
KeyCut was installed. I compiled and installed your app. Ran it : it didn't get any intent. I started your app and that time, KeyCut didn't get no more intent (I wasn't able to make it vibrate).
 
Last edited:
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Yes it does work and Yes it is crazy (in fact the reason why I long time ago asked if a Java dev had more power than a b4a one)...
Manfred had provided the way to open the app's manifest (page 1 of this thread).

Yep, I have managed to get the APK manifest for that app, using manfred's suggestion.

B4X:
?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.lennox.keycut" platformBuildVersionCode="22" platformBuildVersionName="5.1.1-1819727">
  <uses-feature android:name="android.hardware.telephony" android:required="false"/>
  <uses-feature android:name="android.hardware.nfc" android:required="false"/>
  <uses-feature android:name="android.hardware.camera" android:required="false"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  <uses-permission android:name="android.permission.BLUETOOTH"/>
  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
  <uses-permission android:name="android.permission.BROADCAST_STICKY"/>
  <uses-permission android:name="android.permission.CALL_PHONE"/>
  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.CAMERA.FLASHLIGHT"/>
  <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
  <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
  <uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
  <uses-permission android:name="android.permission.FLASHLIGHT" android:permissionGroup="android.permission-group.HARDWARE_CONTROLS" android:protectionLevel="normal"/>
  <uses-permission android:name="android.permission.GET_TASKS"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.READ_CALL_LOG"/>
  <uses-permission android:name="android.permission.READ_CONTACTS"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <uses-permission android:name="android.permission.REORDER_TASKS"/>
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
  <uses-permission android:name="android.permission.VIBRATE"/>
  <uses-permission android:name="android.permission.WAKE_LOCK"/>
  <uses-permission android:name="android.permission.WRITE_CALL_LOG"/>
  <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
  <uses-permission android:name="android.permission.CALL_PRIVILEGED"/>
  <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
  <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL"/>
  <uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"/>
  <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
  <uses-permission android:name="android.permission.REBOOT"/>
  <uses-permission android:name="android.permission.RECOVERY"/>
  <uses-permission android:name="android.permission.SHUTDOWN"/>
  <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <permission android:name="com.lennox.keycut.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
  <uses-permission android:name="com.lennox.keycut.permission.C2D_MESSAGE"/>
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
  <application android:allowBackup="true" android:hardwareAccelerated="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:name="com.lennox.keycut.KeyCutApplication" android:theme="@style/Theme.Custom">
  <activity android:label="@string/app_name" android:launchMode="singleTop" android:name="com.lennox.keycut.KeyCutActivity" android:windowSoftInputMode="adjustPan">
  <intent-filter>
  <action android:name="android.intent.action.MAIN"/>
  <category android:name="android.intent.category.LAUNCHER"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.SETTINGS_ACTIVITY"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  </activity>
  <activity android:launchMode="singleInstance" android:name="com.lennox.keycut.LongPressActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
  <intent-filter android:priority="2147483647">
  <action android:name="android.speech.action.WEB_SEARCH"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  <intent-filter android:priority="2147483647">
  <action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  </activity>
  <activity android:enabled="false" android:launchMode="singleInstance" android:name="com.lennox.keycut.FakeLongPressActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
  <intent-filter android:priority="2147483647">
  <action android:name="android.speech.action.WEB_SEARCH"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  <intent-filter android:priority="2147483647">
  <action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  </activity>
  <receiver android:enabled="true" android:name="com.lennox.keycut.MediaButtonReceiver">
  <intent-filter android:priority="2147483647">
  <action android:name="android.intent.action.MEDIA_BUTTON"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.action.KEY_PRESS"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.action.KEY_LONGPRESS"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.intent.action.SAVE_PREFERENCES"/>
  </intent-filter>
  </receiver>
  <receiver android:enabled="true" android:name="com.lennox.keycut.BootReceiver">
  <intent-filter>
  <action android:name="android.intent.action.BOOT_COMPLETED"/>
  <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
  </intent-filter>
  </receiver>
  <receiver android:enabled="true" android:name="com.lennox.keycut.CallStateReceiver">
  <intent-filter>
  <action android:name="android.intent.action.PHONE_STATE"/>
  </intent-filter>
  </receiver>
  <receiver android:enabled="true" android:name="com.lennox.keycut.CodeReceiver">
  <intent-filter>
  <action android:name="android.provider.Telephony.SECRET_CODE"/>
  <data android:host="539288" android:scheme="android_secret_code"/>
  </intent-filter>
  </receiver>
  <receiver android:enabled="true" android:exported="false" android:name="com.lennox.keycut.HeadsetReceiver">
  <intent-filter>
  <action android:name="com.lennox.keycut.action.HEADSET_PLUG"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.action.HEADSET_UNPLUG"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.action.DISABLE_SERVICE"/>
  </intent-filter>
  <intent-filter>
  <action android:name="com.lennox.keycut.action.RESTART_SERVICE"/>
  </intent-filter>
  </receiver>
  <service android:enabled="true" android:icon="@drawable/ic_launcher" android:name="com.lennox.keycut.KeyService" android:process=":service"/>
  <service android:name="com.lennox.keycut.NotificationListener" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" android:process=":service">
  <intent-filter>
  <action android:name="android.service.notification.NotificationListenerService"/>
  </intent-filter>
  </service>
  <service android:name="com.lennox.keycut.WearListenerService">
  <intent-filter>
  <action android:name="com.google.android.gms.wearable.BIND_LISTENER"/>
  </intent-filter>
  </service>
  <activity android:finishOnCloseSystemDialogs="true" android:label="@string/menu_activity_picker_label" android:name="com.lennox.actions.ActivityPicker" android:theme="@style/Theme.Custom.Apps"/>
  <activity android:finishOnCloseSystemDialogs="true" android:label="@string/menu_activity_picker_label" android:name="com.lennox.actions.ActivityShortcutPicker" android:theme="@style/Theme.Custom.Apps"/>
  <activity android:finishOnCloseSystemDialogs="true" android:label="@string/action_picker_label" android:name="com.lennox.actions.ActionPickerTabs" android:theme="@style/Theme.Custom.ActionPicker"/>
  <activity android:configChanges="keyboardHidden|orientation" android:enabled="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:label="@string/app_name_actions" android:launchMode="singleInstance" android:name="com.lennox.launchers.ActionLauncher" android:taskAffinity="com.lennox.launchers" android:theme="@android:style/Theme.Translucent.NoTitleBar">
  <intent-filter>
  <action android:name="com.lennox.actions.keycut.LAUNCH_ACTION"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  </activity>
  <activity android:configChanges="keyboardHidden|orientation" android:enabled="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:label="@string/app_name_actions" android:launchMode="singleInstance" android:name="com.lennox.launchers.ActivityLauncher" android:taskAffinity="com.lennox.launchers" android:theme="@android:style/Theme.Translucent.NoTitleBar">
  <intent-filter>
  <action android:name="com.lennox.actions.keycut.LAUNCH_ACTIVITY"/>
  <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>
  </activity>
  <activity android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:label="@string/hotword" android:launchMode="singleTask" android:name="com.lennox.actions.HotwordsActivity" android:taskAffinity=".hotwords" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
  <activity android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:label="HotwordSetupActivity" android:name="com.lennox.actions.HotwordSetupActivity" android:taskAffinity=".hotwords"/>
  <activity android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:label="@string/toolbox" android:launchMode="singleTask" android:name="com.lennox.actions.ToolboxActivity" android:taskAffinity=".toolbox" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
  <receiver android:name="com.lennox.actions.KeyAdminReceiver" android:permission="android.permission.BIND_DEVICE_ADMIN">
  <meta-data android:name="android.app.device_admin" android:resource="@xml/device_admin"/>
  <intent-filter>
  <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
  </intent-filter>
  </receiver>
  <activity android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" android:launchMode="singleTask" android:name="com.lennox.actions.RebootDialog" android:taskAffinity=".reboot" android:theme="@style/TransparentDialogTheme"/>
  <receiver android:label="@string/app_name" android:name="com.lennox.keycut.KeyCutWidgetProvider">
  <intent-filter>
  <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
  <action android:name="com.lennox.actions.keycut.WIDGET_PRESSED"/>
  </intent-filter>
  <meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info"/>
  </receiver>
  <service android:enabled="true" android:label="@string/toggle_flashlight" android:name="com.lennox.flashlight.FlashlightService" android:process=":flashlight"/>
  <receiver android:enabled="true" android:exported="false" android:label="@string/toggle_flashlight" android:name="com.lennox.flashlight.FlashlightSwitch" android:process=":flashlight">
  <intent-filter>
  <action android:name="com.lennox.actions.keycut.FLASHLIGHT_TOGGLE"/>
  <action android:name="com.lennox.actions.keycut.FLASHLIGHT_ABORT_CAMERA"/>
  </intent-filter>
  </receiver>
  <service android:exported="false" android:name="com.lennox.soundrecorder.RecorderService"/>
  <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
  <activity android:excludeFromRecents="true" android:launchMode="singleInstance" android:name="com.lennox.utils.activities.LeakableActivity" android:theme="@android:style/Theme.Translucent"/>
  <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" android:name="com.google.android.gms.ads.AdActivity" android:theme="@android:style/Theme.Translucent"/>
  <activity android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="true" android:label="@string/follow_title" android:name="com.lennox.preferences.FollowDialog" android:theme="@style/FollowMeDialogTheme"/>
  <activity android:excludeFromRecents="true" android:finishOnTaskLaunch="true" android:launchMode="singleInstance" android:name="com.lennox.crashlytics.CrashDialog" android:process=":crashlytics" android:taskAffinity="com.lennox.crashlytics" android:theme="@android:style/Preference.Holo.CheckBoxPreference"/>
  <receiver android:enabled="true" android:name="com.lennox.utils.receivers.PackageReceiver">
  <intent-filter android:priority="999">
  <action android:name="android.intent.action.PACKAGE_ADDED"/>
  <action android:name="android.intent.action.PACKAGE_CHANGED"/>
  <action android:name="android.intent.action.PACKAGE_REPLACED"/>
  <action android:name="android.intent.action.PACKAGE_REMOVED"/>
  <data android:scheme="package"/>
  </intent-filter>
  <intent-filter android:priority="999">
  <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
  </intent-filter>
  </receiver>
  <activity android:name="com.onesignal.NotificationOpenedActivity"/>
  <service android:name="com.onesignal.GcmIntentService"/>
  <receiver android:name="com.lennox.utils.receivers.OneSignalReceiver" android:permission="com.google.android.c2dm.permission.SEND">
  <intent-filter>
  <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
  <category android:name="com.lennox.keycut"/>
  </intent-filter>
  </receiver>
  <meta-data android:name="io.fabric.ApiKey" android:value="32f836ade67a0fe39593eb6f1551652bd4a9cb67"/>
  <activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity" android:theme="@style/Theme.IAPTheme"/>
  <meta-data android:name="com.google.android.wearable.beta.app" android:resource="@xml/android_wear_micro_apk"/>
  </application>
</manifest>
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
@Jmu5667 : After having installed KeyCut, ran it, uninstalled it, your app got the intent (I have seen the toasts by chance)
I have uninstalled your app and recompiled it. It didn't got any intent anymore.
I have reinstalled KeyCut, ran it, uninstalled it again. Again, your app got the intent

Edit : remade the same test without starting KeyCut (only installing it from Play Store) while your app was already installed : it got the intent immediately

We are definitely missing something here. Someone knows how to do this. What version of android did you do this on ? I appreciate you have noticed this but we need to get this working independently. I have a contract with 300 users waiting for this. I cannot afford to loose business by not achieving this.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Please could you try to add this at the end of the manifest ? I would like to be sure and not make a fake happiness

B4X:
AddReceiverText(intentfilters,<intent-filter android:priority="2147483647">
<action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>)

When I add this, your app seems to get the intent (to be confirmed - KeyCut was uninstalled)


EDIT : nope, uninstalled your app and recompiled it, reinstalled it. I can't get the intent no more
EDIT1: recompiled it and reinstalled it and it got the intent... Currently redoing all the process

EDIT2 : false joy => it is receiving the intents because intentfilters was already started. Nothing to do with the Manifest I had added probably
I am going to study the KeyCut services
 
Last edited:
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Please could you try to add this at the end of the manifest ? I would like to be sure and not make a fake happiness

B4X:
AddReceiverText(intentfilters,<intent-filter android:priority="2147483647">
<action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>)

When I add this, your app seems to get the intent (to be confirmed - KeyCut was uninstalled)


EDIT : nope, uninstalled your app and recompiled it, reinstalled it. I can't get the intent no more
EDIT1: recompiled it and reinstalled it and it got the intent... Currently redoing all the process



Please could you try to add this at the end of the manifest ? I would like to be sure and not make a fake happiness

B4X:
AddReceiverText(intentfilters,<intent-filter android:priority="2147483647">
<action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>)

When I add this, your app seems to get the intent (to be confirmed - KeyCut was uninstalled)


EDIT : nope, uninstalled your app and recompiled it, reinstalled it. I can't get the intent no more
EDIT1: recompiled it and reinstalled it and it got the intent... Currently redoing all the process

EDIT2 : false joy => it is receiving the intents because intentfilters was already started. Nothing to do with the Manifest I had added probably


I just add the new manifest suggestion, and as you say false joy :(:(
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Please could you try to add this at the end of the manifest ? I would like to be sure and not make a fake happiness

B4X:
AddReceiverText(intentfilters,<intent-filter android:priority="2147483647">
<action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>)

When I add this, your app seems to get the intent (to be confirmed - KeyCut was uninstalled)


EDIT : nope, uninstalled your app and recompiled it, reinstalled it. I can't get the intent no more
EDIT1: recompiled it and reinstalled it and it got the intent... Currently redoing all the process

EDIT2 : false joy => it is receiving the intents because intentfilters was already started. Nothing to do with the Manifest I had added probably
I am going to study the KeyCut services

I am also looking at key cut to see if there is anything usefull to see, talk later.
 
Upvote 0
Top