noob question: how to call an app in the manifest.xml file - General Questions and Answers

I think I'm more ignorant on developing than a stone... I just have some Matlab skills.
What I'm looking for is to modify the manifest file of a lockscreen (five points lockscreen for MIUI) to make it launch the apps I want.
This is the original code:
Code:
<EndPoint x="108" y="404" w="10" h="10">
<Intent action="android.intent.action.MAIN" package="com.miui.camera" class="com.miui.camera.Camera"/>
<ReachedState>
<Image x="60" y="376" src="reached_camera.png"/>
</ReachedState>
<Path tolerance="300">
<Position x="193" y="515" />
<Position x="108" y="404" />
</Path>
</EndPoint>
I know I have to modify this line: <Intent action="android.intent.action.MAIN" package="com.miui.camera" class="com.miui.camera.Camera"/> but I don't know how to refer to the apps I want.
Is there any Guide or sort of list which could help me with that?
I've found some threads about this lockscreen and there were also one in which the developer could make changes on demand. Although, as I'm still not sure about what I would like to put in there (could be google maps, whatsapp, "new sms" etc...), I'd like to try many different solutions without asking everytime...
Could you give some advices?
Thx
ps: I attached the mtz of the lockscreen

Related

Editing the Xperia Play (slide open) app

See Post 21 for guide on how to add modify your apps to appear in the launcher....
Orignal post below...
Hi,
Ok, it really annoyed me that when I flipped open the game pad I could only see the apps Sony Erricson allowed.... I have made some progress on this front, just not a 100% working fix yet
I'm not an expect, so please don't flame me if this is useless info!
Here goes the instructions....
I will warn those who have little skill in editing files this is not for you!
Here is how I added Solitare (free app from the android market) as a test to the Xperia Play Launcher....
First browse to
data/data/com.sonyericsson.semcsuite/databases
copy the to content.db file to your computer
edit the content.db
with SQLite (which you can download for free)
The info you need to edit is under browse data in SQLite, you need the pkg name of the app you want to include inside, as well as the full name of the app you are inserting… I simply replaced an app I wasn't bothered about in the launcher, my assumption would be that you can insert more by following the numbering convention used!
In the cover column you need to use -1 as the cover name and false under the menu...
then save the file
Now reboot the phone open the xperia play app, click on more games…. Then copy over the file…. I copied over the file while on more games….
Then kill the app in the settings (in mine shows as Android System), finally reopen the app and the added applications will show!
You then have the added apps you want in the launcher
Here is a screenshot of the added solitaire app as a test:
imageshack.us/photo/my-images/821/screenshot2zm.png
The big problem I have found so far is that the app very frequently ovewrites the .db For example on reboot or sometimes randomly, so at the moment it's not an actual fix...
I have attempted making the file read only but this crashes the app on opening...
But progress is progress any ideas moving forward? It would be nice to be able to slide open your play and see a bunch of emulators
Chris
AndroHero said:
Look in the database.db file in /data/data/com.sonyericsson.semcsuite/database
Sent from my R800i using Tapatalk
Click to expand...
Click to collapse
i told them all they needed to edit the database.db but no1 beleved me lol
AndroHero said:
i told them all they needed to edit the database.db but no1 beleved me lol
Click to expand...
Click to collapse
Just found your old thread, damn could have been here sooner! Oh, well progress still made
So much better knowing I can slide open my play and see all my emulators!
I've found out that once you get the hacked.db file on the play and get it to open correctly provide you press the home button and not the back button then it stays put Hopefully it should stay in place unless I accidently quit the app or need to reboot!
Still not a permanant fix, but close enough until we figure out how to stop the app replacing the edited file!
Here are two new screenshots completed with emulators hehe
imageshack.us/photo/my-images/853/screenshotye.png/
imageshack.us/photo/my-images/200/screenshot1kv.png/
The only downside is that the app blows up the icon of the edited in app, so it looks a bit pixelated - but I really don't care about that!
Chris
deepestblue said:
Just found your old thread, damn could have been here sooner! Oh, well progress still made
So much better knowing I can slide open my play and see all my emulators!
I've found out that once you get the hacked.db file on the play and get it to open correctly provide you press the home button and not the back button then it stays put Hopefully it should stay in place unless I accidently quit the app or need to reboot!
Still not a permanant fix, but close enough until we figure out how to stop the app replacing the edited file!
Here are two new screenshots completed with emulators hehe
imageshack.us/photo/my-images/853/screenshotye.png/
imageshack.us/photo/my-images/200/screenshot1kv.png/
The only downside is that the app blows up the icon of the edited in app, so it looks a bit pixelated - but I really don't care about that!
Chris
Click to expand...
Click to collapse
that looks really cool maybe a line in one of the .xml files can be changed in the .apk to get it to read from a diffrent (modded) file, then it dosent matter if it rewrites the database.db file
Could the whole db edition be done through an app?
Yes, we know, this is nothing new. We've already known about this for weeks. The problem of course is that it has to be populated manually. We've been searching for a way to do this automatically just by looking at how it works and doing what needs to be done to tell it "hey, I should be on this list" whenever it rebuilds the database.
Well so far good news, the xperia play app has yet to overwrite the file, so I guess leaving it the app open and not quiting, is possibly a very good temporary solution.
AndroHero said:
that looks really cool maybe a line in one of the .xml files can be changed in the .apk to get it to read from a diffrent (modded) file, then it dosent matter if it rewrites the database.db file
Click to expand...
Click to collapse
Unfortunately, after taking a look at the xml files no joy
There doesn't seem to be any reffrence to writing to the .db or that location...
Within the apk, there is a searchable.xml file though where the app is asking to search. So, possibly changing this so it searches for something else? hmm
The problem is if you change it to something else then I assume it would create a blank .db file! LOL But this might be a way forward... Feel free to take a look at the included xml file of the launcher here:
mediafire.com/?2eqtw1f0358omp2
Logseman said:
Could the whole db edition be done through an app?
Click to expand...
Click to collapse
Probably, if someone wanted to create such an app... But editing the .db file is not so hard, provided you are not wanting to change things all the time! I'd write up step by step instructions, so it should be fairly easy...
The problem at the moment is that it is not a full solution to our problem...
zerojay said:
Yes, we know, this is nothing new. We've already known about this for weeks. The problem of course is that it has to be populated manually. We've been searching for a way to do this automatically just by looking at how it works and doing what needs to be done to tell it "hey, I should be on this list" whenever it rebuilds the database.
Click to expand...
Click to collapse
I've had a scan though the past posts, and yes your right the .db file was known about for weeks... But unfortunately not followed though, no one actually attempted to edit the .db file nor get the edited file to work or at least not that I can see.... It's a shame really as we could have been here sooner...
Actually, I have an idea of how the app decides what should go into the database... I believe it is rather simple how the app works... The app will search installed apk, then my assumption would be that it would look at the AndroidManifest.xml of said installed apps for an xperiaplayoptimized_content tag.
An xperiaplayoptimized_content tag can be seen in the AndoridManifest.xml of two free apps on the market Cyberlords - Arcology, Happy Vikings.... I've not checked any other apps from the market, but please check more - maybe I'm wrong .
The problem is if this is how the app works and is needed in every app, it would mean adding to evey app we wanted to be included in the launcher and removing from every app we did not want to appear in the launcher, sigh...
I suppose if someone wants they could check this for certain by adding an xperiaplayoptimized_content tag to an app or removing the tag from an app and seeing what happens...
So, I'm thinking three possible options? Unless any can think of any further solutions?
a) Change how the Xperia Play app searches - possibly by editing the searchable.xml file - although I'm not sure what to change the search to?
b) Add the xperiaplayoptimized_content tag to every maifest of every app we want included - that's also, assuming xperiaplayoptimized_content is the correct tag!
c) Leave things as they are - you just lose the changed .db file on reboot or when you close the application by mistake. Perhaps even a simple app to replace .db file when this happens?
Sigh, so much work/effort for something simple - damn you Sony Erricson! LOL
Chris
Hurray, it works
Added this line:
Code:
<meta-data android:name="xperiaplayoptimized_content" android:resource="@drawable/icon" />
right before:
Code:
</application>
you can probably use the @drawable to make it any icon you want.
The happy viking game uses a resolution of 170*170 I believe.
Now is there anyone with the skills to have the android manifests modified of allready installed apps with a nice menu where you could select wich app you want to have the line added to the manifest? If that's possible at all.
Edit: updated the app I use for testing stuff so it shows up in the game launcher: http://forum.xda-developers.com/showthread.php?p=14451093#post14451093
svenk919 said:
Hurray, it works
Added this line:
Code:
<meta-data android:name="xperiaplayoptimized_content" android:resource="@drawable/icon" />
right before:
Code:
</application>
you can probably use the @drawable to make it any icon you want.
The happy viking game uses a resolution of 170*170 I believe.
Now is there anyone with the skills to have the android manifests modified of allready installed apps with a nice menu where you could select wich app you want to have the line added to the manifest? If that's possible at all.
Edit: updated the app I use for testing stuff so it shows up in the game launcher: http://forum.xda-developers.com/showthread.php?p=14451093#post14451093
Click to expand...
Click to collapse
Great work , just tested your app! Awesome we now know for certain that xperiaplayoptimized_content is the correct tag...
Ageed it needs someone skilled - but an app that acutally modifies the manifests already installed apps is far beyond what I can do
As you say I'm not even sure such a feat is possible?
An alternative may be to decompile your apps and recompile them... Apktool, should do the trick...
code.google.com/p/android-apktool/
Hmm, tempting... I think I might have a go with one app, see how long it takes to decompile, edit and recompile an app!
deepestblue said:
Great work , just tested your app! Awesome we now know for certain that xperiaplayoptimized_content is the correct tag...
Ageed it needs someone skilled - but an app that acutally modifies the manifests already installed apps is far beyond what I can do
As you say I'm not even sure such a feat is possible?
An alternative may be to decompile your apps and recompile them... Apktool, should do the trick...
code.google.com/p/android-apktool/
Hmm, tempting... I think I might have a go with one app, see how long it takes to decompile, edit and recompile an app!
Click to expand...
Click to collapse
Maybe an app along the lines of ninjamorph but more dedicated to editing the android mainifest
Sent from my R800i using Tapatalk
AndroHero said:
Maybe an app along the lines of ninjamorph but more dedicated to editing the android mainifest
Sent from my R800i using Tapatalk
Click to expand...
Click to collapse
Hi, I tried ninjamorph but it didn't actually decompile the the android manifest...
However apktool did!
So, it's a simple matter of copying your apk, decompile with apktool, add the xperia play optimized tag, recompile with apktool and then install
It's a much quicker process than it sounds, and to add the tag to an app in total takes about 15 mins with install...
If anyone wants step by step instructions let me know!
It's so much better having the apps you want in the launcher....
deepestblue said:
Hi, I tried ninjamorph but it didn't actually decompile the the android manifest...
However apktool did!
So, it's a simple matter of copying your apk, decompile with apktool, add the xperia play optimized tag, recompile with apktool and then install
It's a much quicker process than it sounds, and to add the tag to an app in total takes about 15 mins with install...
If anyone wants step by step instructions let me know!
It's so much better having the apps you want in the launcher....
Click to expand...
Click to collapse
If it isnt too much trouble,could you please post the step by step process. I would greatly appreciate it.
I picked the Xperia Play Camera Mod app, courtesy of Zoop57, to tinker a bit. svenk's suggestion left me with this error:
Code:
C:\Users\Logseman\Downloads\seb.camera.mod-1\AndroidManifest.xml:46: error: Error: No resource found that matches the given name (at 'resource' with value '@drawable/icon').
and some others chained to it. I presume we need to add something more than that line? This is the first time I actually use apktool, so I can perfectly have missed something.
apk tool should give a "res" map, if you have folders like: "drawable-h/m/ldpi" look into it, mostly it has an icon named "icon.png" but it could be named different with the camera app, if it is different change the icon '@drawable/icon' to what the file is named in the camera app. If such folders don't exist you probably have to chancgte the '@drawable' part to.
PS.
I think the line of code in case of the camera app should be:
Code:
<meta-data android:name="xperiaplayoptimized_content" android:resource="@drawable/ic_launcher_camera" />
I managed to build the app using "@drawable/ic_launcher_camera" in that field. However, after installing it, it won't show in the Xperia Play launcher with the games. Moreover, I decoded fifa.apk, which does appear in the launcher as Fifa 10, and it doesn't show that line on the Manifest:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1034" android:versionName="1.0.34" package="com.eamobile.Fifa"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name=".Fifa" android:launchMode="singleTask" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
Did you reboot the phone? The launcher doesn't refresh its database all the time. The line was there with the happy vikings game and it did work to add my touchpadtester app to my launcher.
I've uninstalled the app, reinstalled it, opened it, closed it and rebooted the phone to no avail. It won't show in the menu.
Does the camera app uses sdk version 9 or later? It should be stated in the manifest. Probably the xperia play optimized tag only works since android 2.3.2.
svenk919 said:
Does the camera app uses sdk version 9 or later? It should be stated in the manifest. Probably the xperia play optimized tag only works since android 2.3.2.
Click to expand...
Click to collapse
Hmmm... Zoop mentioned that he grabbed the latest source, so it should be 2.3.4.
Here's the manifest of his camera mod:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="5" android:versionName="5" package="seb.camera.mod"
xmlns:android="http://schemas.android.com/apk/res/android">
<original-package android:name="com.android.camera" />
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_SMS" />
<application android:label="Camera Mod" android:icon="@drawable/ic_launcher_camera" android:taskAffinity="">
<receiver android:name="com.android.camera.CameraButtonIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.CAMERA_BUTTON" />
</intent-filter>
</receiver>
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:name="com.android.camera.Camera" android:taskAffinity="android.task.camera" android:clearTaskOnLaunch="true" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:label="@string/video_camera_label" android:icon="@drawable/ic_launcher_video_camera" android:name="com.android.camera.VideoCamera" android:taskAffinity="android.task.camcorder" android:clearTaskOnLaunch="true" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.media.action.VIDEO_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.VIDEO_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
This is the manifest of my touchpad app:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="test.play.controls"
xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.2" android:versionCode="2">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" />
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name="android.app.NativeActivity" android:launchMode="singleInstance" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation">
<meta-data android:name="android.app.lib_name" android:value="touchpadndk" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="xperiaplayoptimized_content" android:resource="@drawable/launchericon" />
</application>
</manifest>

[MOD] Hack Samsung MultiWindow Framework

Lennyuk said:
So it seems that only certain apps work with multi-screen and it is not just samsung apps.
Here I plan (with your help) to create a difinitive list of all apps that will work.
I have already noticed that some apps allow themselves to be splitscreened even when they do not appear in that list e.g. official twitter app.
Some apps you will find when you press the edit button, you can then drag them to the main list, or remove ones you do not use.
Samsung Apps
- ChatON
- Email
- Gallery
- Internet
- Messaging
- S-Note
- Video Player
Google Apps
- Chrome
- Gmail
- Maps
- Talk
- Youtube
Third Party Apps
- Facebook
- Official Twitter app
- Polaris (Viewer)
Note: you will need to be using Samsung stock keyboard to benefit from typing when on multi-screen mode, otherwise your keyboard will cover the entire bottom screen.
Click to expand...
Click to collapse
Here is all the info until now. Few days i go i received my new device N7100
Hello,
¡I just found some a nice surprise!
looking at running services, finally found that com.sec.android.app.FlashBarService its how control what app get listed in our whilelist apps to keep it on multiwindows.
XML info its saved at: /data/data/com.sec.android.app.FlashBarService\shared_prefs/flash_bar_list.xml
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="com.sec.chaton.HomeActivity" value="1" />
<int name="com.google.android.apps.chrome.Main" value="2" />
<int name="com.android.email.activity.Welcome" value="3" />
<int name="com.sec.android.gallery3d.app.Gallery" value="4" />
<int name="com.facebook.katana.LoginActivity" value="5" />
<int name="com.google.android.gm.ConversationListActivityGmail" value="6" />
<int name="com.google.android.talk.SigningInActivity" value="7" />
<int name="com.android.browser.BrowserActivity" value="8" />
<int name="com.google.android.maps.MapsActivity" value="9" />
<int name="com.android.mms.ui.ConversationComposer" value="10" />
<int name="com.twitter.android.StartActivity" value="11" />
<int name="com.infraware.filemanager.FmFileTreeListActivity" value="12" />
<int name="com.sec.android.app.videoplayer.activity.MainTab" value="13" />
<int name="com.google.android.youtube.app.honeycomb.Shell$HomeActivity" value="14" />
<int name="NUM_APP_IN_FILE" value="15" />
<boolean name="FILE_SAVE" value="true" />
</map>
After deoxing flashbarservice and jar it ive got the clear sources! Thats whats im going to share here!
Our interesting right now its allow to give new apps in the whitelist, i tried to manage a few things, like dont allow write, not autosave, and adding by myself my some of this functions in FlashBarInfo.java must to be retouched.
I need some sleep maybe tomorrow finally i can bypass the filters!
Regards,
Kasha
Nice job
Today im back at home, after the missrate searching over the frameservice from the multiwindow, everytime cfg files are changed, instead no write permission or whatever so i think that we have more troubles doing on this part.
Searching for a while a found the first idea. Look at the SystemUI & framework!
SystemUI/com\android\systemui\multiwindow is our folder.
MultiWindowControlPanel.java
MultiWindowListPanel.java
MultiWindowReflector.java
RunningTasksLoader$1$1.java
RunningTasksLoader$1.java
RunningTasksLoader.java
SplitPanelView$1.java
SplitPanelView$2.java
SplitPanelView$3.java
SplitPanelView$4.java
SplitPanelView.java
Utilities.java
Click to expand...
Click to collapse
res\layout\status_bar_multi_window_arrange.xml
res\layout\status_bar_multi_window_list.xml
Click to expand...
Click to collapse
I found some interesting info about how the system reads and class our apps.
As I said on the previous thread in the general section:
After looking around a bit, I have collected enough info about this.
If I ever get a note 2 (which I'm thinking about), I am sure I can give the user the ability to add apps to the multiwindow bar. But only if .
Anyway, I honestly wish good luck to everyone trying this .
PS. has anyone tried adding a package name into the string array, inside arrays.xml?
for example, the package name of skype, add it in the bottom, install skype and see if it appears. (It should)
Click to expand...
Click to collapse
Man I wish I could help, but I don't even have my Note 2 yet, or well the knowledge of how to do it. I wish y'all the best of luck, I know this hack for multi-window will blow up once it's finally released in the US, Canada, etc. Thanks for the time.
adding apps to the list is as easy as adding a new package name to the arrays.xml in framework-res.apk
Paul o'Brien (Modaco) posted a pic on twitter yesterday as proof of concept, he had plume and a game, subway surfers, running in multi-screen.
What we really need now is to think of the best way to handle this so that we can easily have all the apps people would want in the list:
1) one way would be to make a list of apps people use and build one giant xml list, this is not ideal but would work.
2) another way would be to have some sort of app to rebuild the xml file based on your installed apps at that time
3) the best way will be to remove the check itself completely, or point the check somewhere else so we can make a local list say on the sd card.
I hope so bad, that someone can manage it. Would be awesome and it doesn't seem to be much complicated.
Well I did just toy with the idea of making a quick dirty VRTheme update.zip to change the xml file to a new list of pre-defined items.
Then I remembered that the xml we need to edit is in /res/values/arrays.xml
VRTheme cannot update /values/ files as the apk needs to be decompiled and recompiled to edit these, no one has come up with a way to do this via an update-script yet.
So that quick fix is out the window.
Lennyuk said:
Well I did just toy with the idea of making a quick dirty VRTheme update.zip to change the xml file to a new list of pre-defined items.
Then I remembered that the xml we need to edit is in /res/values/arrays.xml
VRTheme cannot update /values/ files as the apk needs to be decompiled and recompiled to edit these, no one has come up with a way to do this via an update-script yet.
So that quick fix is out the window.
Click to expand...
Click to collapse
i dont know about VRTHEME, but in alliance ROM using ROm customizer app, one can flash the theme with *.xml files as well
I'm reading this thread and I can't wait to dive into dalvik and try to hack this.
Tonight I am getting my note 2, and I hope to learn lots by exploring this hack.
Have messed around with XMLs and decompile/recompile, also some dalvik but not much.
Paul O'Brien has managed to allow all apps to be shown, not sure what he has done yet to allow this, he said its not finished so we won't know for sure until he is happy with it and releases it, but is certainly a positive start.
grgsiocl said:
i dont know about VRTHEME, but in alliance ROM using ROm customizer app, one can flash the theme with *.xml files as well
Click to expand...
Click to collapse
APK's generally have lots of xml files, some are editable and visible if you just open the apk up as if it was a .zip, these can be changed by the methods there are availiable to do via update.zip (VRTheme or people who have since copied this idea).
some of them are hidden until you decompile the app these are generally the files in /values/.
In the case here the xml we want to edit is in /values/ so there is no existing way an update.zip could edit these.
Hi guys.I will try and help.dont have anytime on my hands these days..very slow internet as my dorms use wireless connection.I have stopped a few other mods on the Note II for about a week now including a rom i was going to upload..
Tonight i will sit down and have a look at whats given in this thread and i can try and update the list with the most popular apps around,and maybe compile a simple app in C++ that can simply add apps to the xml list without you having to open it .well will see.
I have made a new framework-res.apk with a handful of apps that I use (no games, not much point).
I will make it into an update.zip and upload it soon.
this is not a perfect fix as obviously you will only have the apps I added to the list but it might keep some of you going until we get a real fix
Look out for some pretty major news from Modaco later about this split-screen feature too
Lennyuk said:
Look out for some pretty major news from Modaco later about this split-screen feature too
Click to expand...
Click to collapse
Where can we follow modaco?
My mod is here - http://forum.xda-developers.com/showthread.php?t=1939780
You can follow modaco at Modaco.com or on twitter @paulobrien and @modaco
Lennyuk said:
I have made a new framework-res.apk with a handful of apps that I use (no games, not much point).
I will make it into an update.zip and upload it soon.
this is not a perfect fix as obviously you will only have the apps I added to the list but it might keep some of you going until we get a real fix
Click to expand...
Click to collapse
Hope its got xda app most used here probably ...thx
Sent from my GT-N7100 using xda premium
stesteste said:
Hope its got xda app most used here probably ...thx
Sent from my GT-N7100 using xda premium
Click to expand...
Click to collapse
sorry, I forgot about that, I added tapatalk but not xda's version

[MOD][HOW-TO] Add an item to Settings

You mainly see these kinds of things in AOSP ROMs, but I'll teach you guys how to add a "Tweaks" option to the Settings app. Some people know how to do this, others don't. In the spirit of making a better community, here's the how-to. I'll be using the MIUI batterybar by PvyParts as the example. So, to add the MIUI batterybar to Settings, follow the following steps:
Note: You must have already made your ROM compatible with the batterybar mod for it to work. This guide just teaches you how to add things to it. Also, this guide works only if you have a tweaks app such as the batterybar, quickpanel settings, etc so make sure you have those apps installed.​
[*]Decompile SecSettings.apk (I use Apk Manager)
[*]Navigate to /res/xml/settings_headers.xml
Add
Code:
<header android:title="@string/header_category_rom_mods" />
<header android:icon="@drawable/ic_settings_batterybar" android:id="@id/batterybar_settings" android:title="@string/batterybar_settings">
<intent android:targetPackage="com.pvy.battbar.settings" android:action="android.intent.action.MAIN" android:targetClass="com.pvy.battbar.settings.options" />
</header>
below
Code:
<header android:icon="@drawable/ic_settings_more" android:id="@id/wireless_settings" android:title="@string/more_settings" android:fragment="com.android.settings.WirelessSettings" android:breadCrumbTitle="@string/wireless_networks_settings_title" />
It'll look like this when finished:
Code:
<header android:icon="@drawable/ic_settings_more" android:id="@id/wireless_settings" android:title="@string/more_settings" android:fragment="com.android.settings.WirelessSettings" android:breadCrumbTitle="@string/wireless_networks_settings_title" />
[COLOR="SeaGreen"] <header android:title="@string/header_category_rom_mods" />
<header android:icon="@drawable/ic_settings_batterybar" android:id="@id/batterybar_settings" android:title="@string/batterybar_settings">
<intent android:targetPackage="com.pvy.battbar.settings" android:action="android.intent.action.MAIN" android:targetClass="com.pvy.battbar.settings.options" />
</header>[/COLOR]
[*]Navigate to /res/values/strings.xml
Scroll to the bottom of the file and add
Code:
<string name="header_category_rom_mods">ROM Control</string>
<string name="batterybar_settings">Battery Bar</string>
right above
Code:
</resources>
It'll look like this when finished (You can name "ROM Control" and "Battery Bar" to whatever you want):
Code:
[COLOR="SeaGreen"]<string name="header_category_rom_mods">ROM Control</string>
<string name="batterybar_settings">Battery Bar</string>[/COLOR]
</resources>
[*]Navigate to /res/values/public.xml
This is the tricky part. You will have to assign unique IDs to each mod. Additionally, you will need to assign a "drawable" type (for the picture) and a "string" type (for the name). This is what my code looks like (the red part is the unique ID (you can use mine as long as they don't conflict with any ID in your public.xml)):
At line 797:
Code:
<public type="drawable" name="ic_settings_batterybar" id="[COLOR="Red"]0x7f0203e2[/COLOR]" />
At line 4871:
Code:
<public type="string" name="batterybar_settings" id="0x7f090e3a" />" id="[COLOR="red"]0x7f0203e2[/COLOR]" />
At line 4869:
Code:
<public type="string" name="header_category_rom_mods" id="[COLOR="red"]0x7f090e38[/COLOR]" />
[*]Navigate to /res/values/ids.xml
Scroll to the bottom of the file and add:
Code:
<item type="id" name="batterybar_settings">false</item>
right above
Code:
</resources>
[*]Recompile SecSettings.apk and push it to your phone.
Awesome, great write up!
A little trick I learned that will allow you to not worry about finding a unique ID for res/public is let the system generate one for you
Add your lines to strings first and nothing else, then re-compile. Then immediately decompile the one you just built. Sounds confusing i know, but.........Now when you open up res/public the lines you just added to strings will have automatically populated with thier own unique ID and you never had to do anything. Try it
Much easier than trying to figure out which HEX ID isnt used, whats in range, or whats next.
:good:
Interesting, I used to wonder how you guys add things like that...
Didact74 said:
Awesome, great write up!
A little trick I learned that will allow you to not worry about finding a unique ID for res/public is let the system generate one for you
Add your lines to strings first and nothing else, then re-compile. Then immediately decompile the one you just built. Sounds confusing i know, but.........Now when you open up res/public the lines you just added to strings will have automatically populated with thier own unique ID and you never had to do anything. Try it
Much easier than trying to figure out which HEX ID isnt used, whats in range, or whats next.
:good:
Click to expand...
Click to collapse
So you're saying do step three first, then step two and then step 4?
Sent from my SCH-I535 using xda app-developers app
Twisted politiks said:
So you're saying do step three first, then step two and then step 4?
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Crap, I am sorry if it was confusing. I didn't want to muddle up PM's thread. I would stick to his instructions if you don't quite follow what I was saying. It was meant for those that spend a lot of time running through code. Basically you can skip the part of adding IDs to res/public because once you add your info to strings the recompile process auto generates the IDs for you.
If this confuses you just stick to PMs instructions. : )
收件人: [MOD][HOW-TO] Add an item to Settings
I will try it .thx
Sent from my HTC X515d using xda premium

[HELP] Modding CM7 Torch to provide a toggle-shortcut

Hey Guys,
I am currently running the latest CM7.2 nightly by maniac103 on my Motorola Defy.
CM7 usually has a special modified Nexus One Torch integrated, whose packagename is "net.cactii.flash2".
As I would like to assign a torch-toggle to a slider in widgetlocker, I need the torch-app to provide a shortcut/activity since it only offers a toggle-widget.
I am talking about the app-specific shortcuts not the shortcuts that directly link to an app.
EDIT: The reason why I haven't put this in Q&A is that this is hopefully going to be a mod, so it may save the mods some time for not needing to push it to another forum...
I may have already found out that the receiver the torch uses is called "net.cactii.flash2.TorchSwitch" and the intent it expects is "net.cactii.flash2.TOGGLE_FLASHLIGHT".
I am not sure though, if I got this whole Intent-/Receiver-thingy right... Any corrections are appreciated.
From this tutorial I have learnt, that apps provide these shortcut-entries in their AndroidManifest.xml. I should be able to modify, recompile and sign this apk.
I just don't know exactly, how I have to add this to the AndroidManifest.xml in terms of syntax and language. That's where I need help...
EDIT: Here's the code of the AndroidManifest.xml for quick review:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" package="net.cactii.flash2"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name=".MainActivity" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".WidgetOptionsActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver android:label="Torch" android:name="TorchWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="net.cactii.flash2.TORCH_STATE_CHANGED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
<service android:name=".TorchService" android:enabled="true" />
<receiver android:label="@string/app_name" android:name="TorchSwitch" android:enabled="true">
<intent-filter>
<action android:name="net.cactii.flash2.TOGGLE_FLASHLIGHT" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.flash" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Before you tell me now, that I should use a different flashlight-app: I was already using TeslaLED which runs well with WidgetLocker.
However, the in-built torch offers a high brightness-mode that I want to use. Additionally, TeslaLED always needs 2-3 seconds to activate the flashlight, unlike Torch, which usually toggles instantly...
I have appended the torch-apk, as well as the AndroidManifest.xml I want to modify.
Here is an additional link (from another dev), which shows shortly, how the torch app works together with a statusbar-toggle, if that helps in any way...
Summary of what is needed: A mod for net.cactii.flash2's AndroidManifest.xml which provides a high brightness flashlight toggle-shortcut
If you potentially know how to write this short piece of code and you just want to know how android handles these shortcuts, please read this tutorial. It's very short and helpful.
EDIT: It seems that we have to modify the app as well, not just the AndroidManifest.xml, because it would place a shortcut in the menu, but Torch wouldn't know what to do when I select this item. Feel free to post your ideas and/or corrections
EDIT: Alternatively we could try to make Torch listen to TeslaLED's intents, but I think that would be more sophisticated and could lead to problems, when both apps are installed...
Thanks for any help in advance!
Greetz, Unr3aL67
Unr3aL67 said:
"net.cactii.flash2.TOGGLE_FLASHLIGHT"
Click to expand...
Click to collapse
thanks!
I used this line in Tasker with Send Intent to toggle Torch on my CM10.2.
Gawis said:
thanks!
I used this line in Tasker with Send Intent to toggle Torch on my CM10.2.
Click to expand...
Click to collapse
Okay, I'm using tasker to make a widget via power toggles... I used the same line in tasker, and it works great! Here's what I'm wondering now...
In power toggles, with regular toggles, you can have the icon change colors, say it would be green when the flashlight is on, and gray when off... Obviously you can't do that by just sending the intent, so anyone have any ideas about how to do this?
I know power toggles uses Tesla by default, but I don't like the delay.. Torch is on immediately, so thats what I want to use.
Any ideas would be greatly appreciated!
Gawis said:
thanks!
I used this line in Tasker with Send Intent to toggle Torch on my CM10.2.
Click to expand...
Click to collapse
Okay, I figured it out... The following task, paired with power toggles, works great! The button is off when the light is off, and the button is in the "Active" state when the light is on.. For mine its Gray when the light is off, and Green when the light is on....
If %Toggle ~ 1
Send Intent
Action net.cactii.flash2.TOGGLE_FLASHLIGHT
Variable Set
Name %Toggle To 0
Else
Send Intent
Action net.cactii.flash2.TOGGLE_FLASHLIGHT
Variable Set
Name %Toggle To 1
End If
Modify PowerToggle state
Configuration Set current toggle to off
If %Toggle ~ 0
Modify PowerToggle state
Configuration Set current toggle to on
If %Toggle ~ 1
Hope this helps someone figure this out! LOL! If it helped you, please thumbs up... Too busy to be on XDA all the time....

Question Disable Swipe To Dismiss (Go Back)?

TL;DR - Is there a way to disable the swipe right to go back feature?
I recently sideloaded a VNC viewer on the Watch 4 to access apps on my phone/computer, and it works well except when I try to move the mouse cursor to the right, the watch exits and disconnects the VNC client. Same problem with scrolling the screen to the right when zoomed in. The only workaround that I have found is to move the cursor to the top or bottom of the screen with a slight rightward motion until the cursor is far to the right, then move it back down/up. Is there a way to disable the swipe right to go back feature, or is there an on-screen input app, such as a joystick, that will work? Perhaps a different VNC viewer might work better? Thanks!
Do not think there is a way to disable the swipe. At least I could not find one.
Also, haven't seen any way to disable it....
TacoDeMuerte said:
TL;DR - Is there a way to disable the swipe right to go back feature?
I recently sideloaded a VNC viewer on the Watch 4 to access apps on my phone/computer, and it works well except when I try to move the mouse cursor to the right, the watch exits and disconnects the VNC client. Same problem with scrolling the screen to the right when zoomed in. The only workaround that I have found is to move the cursor to the top or bottom of the screen with a slight rightward motion until the cursor is far to the right, then move it back down/up. Is there a way to disable the swipe right to go back feature, or is there an on-screen input app, such as a joystick, that will work? Perhaps a different VNC viewer might work better? Thanks!
Click to expand...
Click to collapse
Thats an OS feature, if there was a way to disable it you would probably lose all gestures.
Thanks for the replies guys! I had a hunch that it was more of a communication between the apps and the OS and have found some information. There are flags that need to be set within the app that disable swipe to dismiss while a scrollable overlay is selected. This is how something like Google Maps on the watch will allow tap + drag in any direction as well as scrolling through menus in other apps. I would think there would also be a flag/setting somewhere within the OS to disable swipe-to-dismiss altogether, but perhaps we will need to wait for custom ROMs for that. In the meantime, I will work on customizing the UI of apps to ignore swipe-to-dismiss.
Some additional information:
https://developer.android.com/reference/kotlin/androidx/wear/widget/SwipeDismissFrameLayout
Code:
"To suppress a swipe-dismiss gesture, at least one contained view must be scrollable,
indicating that it would like to consume any horizontal touch gestures in that direction.
In this case this view will only allow swipe-to-dismiss on the very edge of the left-hand-side of the screen.
If you wish to entirely disable the swipe-to-dismiss gesture,
setSwipeable can be used for more direct control over the feature."
wear-os - swipedismissframelayout - android wear disable swipe to dismiss
Code:
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
TacoDeMuerte said:
Thanks for the replies guys! I had a hunch that it was more of a communication between the apps and the OS and have found some information. There are flags that need to be set within the app that disable swipe to dismiss while a scrollable overlay is selected. This is how something like Google Maps on the watch will allow tap + drag in any direction as well as scrolling through menus in other apps. I would think there would also be a flag/setting somewhere within the OS to disable swipe-to-dismiss altogether, but perhaps we will need to wait for custom ROMs for that. In the meantime, I will work on customizing the UI of apps to ignore swipe-to-dismiss.
Some additional information:
https://developer.android.com/reference/kotlin/androidx/wear/widget/SwipeDismissFrameLayout
Code:
"To suppress a swipe-dismiss gesture, at least one contained view must be scrollable,
indicating that it would like to consume any horizontal touch gestures in that direction.
In this case this view will only allow swipe-to-dismiss on the very edge of the left-hand-side of the screen.
If you wish to entirely disable the swipe-to-dismiss gesture,
setSwipeable can be used for more direct control over the feature."
wear-os - swipedismissframelayout - android wear disable swipe to dismiss
Code:
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
Click to expand...
Click to collapse
I dont seem to get it working. Could you explain it in steps to make someone like me who doesnt understand code to make this work?
Beekitu said:
I dont seem to get it working. Could you explain it in steps to make someone like me who doesnt understand code to make this work?
Click to expand...
Click to collapse
There are different methods out there, but try this as a starting point:
1. Open Android Studio and create a new project. File > New > New Project > Wear OS > Blank Activity > Next > Finish
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
That should be all you need to get started. Once that is working, read over the code and make the necessary edits to achieve the desired result. For example, the text "Hello Round World!" is still swipeable, but the app doesn't close on a swipe, so you would need to edit the text box's attributes to prevent that from moving on a swipe. Also, check out the Google Maps example project for additional information. Keep in mind that the non-swipe to dismiss layouts are derived from the "Fragment" type of layout.
TacoDeMuerte said:
There are different methods out there, but try this as a starting point:
1. Open Android Studio and create a new project. File > New > New Project > Wear OS > Blank Project
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
That should be all you need to get started. Once that is working, read over the code and make the necessary edits to achieve the desired result. For example, the text "Hello Round World!" is still swipeable, but the app doesn't close on a swipe, so you would need to edit the text box's attributes to prevent that from moving on a swipe. Also, check out the Google Maps example project for additional information. Keep in mind that the non-swipe to dismiss layouts are derived from the "Fragment" type of layout.
Click to expand...
Click to collapse
I'm already stuck on step 2. After I chose Black Project in step 1, it asks me for some information about the project, not sure what I should put there.. And on step 2 im confused from the very start..
Beekitu said:
I'm already stuck on step 2. After I chose Black Project in step 1, it asks me for some information about the project, not sure what I should put there.. And on step 2 im confused from the very start..
Click to expand...
Click to collapse
Just click "Next" then "Finish". You can change the name of your project if you want and can also change the programming language to Java or Kotlin, but shouldn't be necessary. Just click finish.
TacoDeMuerte said:
Just click "Next" then "Finish". You can change the name of your project if you want and can also change the programming language to Java or Kotlin, but shouldn't be necessary. Just click finish.
Click to expand...
Click to collapse
alright. this is currently what I am seeing. Can you explain where I need to go in step 2 using the screenshot?
Beekitu said:
alright. this is currently what I am seeing. Can you explain where I need to go in step 2 using the screenshot?
Click to expand...
Click to collapse
Click "Code" or "Split" near the top right corner. Remember where this is as it comes in handy later. I would also add that this thread isn't meant to be a tutorial on Android Studio, and would highly recommend searching for an introduction video tutorial of Android Studio before proceeding further.
TacoDeMuerte said:
Click "Code" or "Split" near the top right corner. Remember where this is as it comes in handy later. I would also add that this thread isn't meant to be a tutorial on Android Studio, and would highly recommend searching for an introduction video tutorial of Android Studio before proceeding further.
Click to expand...
Click to collapse
I understand nothing about coding and dont plan on learning coding. I just want to disable swipe right gesture on my watch. after that I do not plan on using Android studio in the future..
Beekitu said:
I understand nothing about coding and dont plan on learning coding. I just want to disable swipe right gesture on my watch. after that I do not plan on using Android studio in the future..
Click to expand...
Click to collapse
Oh I see. Unfortunately, these steps will not accomplish what you need. These steps are for app development. The solution to disabling the swipe gesture has still not been found. I suspect it will require root access and maybe a custom kernel or ROM. Some people have mentioned patching individual apps to disable swipe to dismiss, but as far as I know, they haven't posted the process to do so. I think it involves decompiling the .apk, making similar edits to the steps above, then recompiling, which is a more complicated process than the steps I posted, and would need to be done for every app you use.
I believe we will have to wait for root access to disable the gesture altogether.
TacoDeMuerte said:
Oh I see. Unfortunately, these steps will not accomplish what you need. These steps are for app development. The solution to disabling the swipe gesture has still not been found. I suspect it will require root access and maybe a custom kernel or ROM. Some people have mentioned patching individual apps to disable swipe to dismiss, but as far as I know, they haven't posted the process to do so. I think it involves decompiling the .apk, making similar edits to the steps above, then recompiling, which is a more complicated process than the steps I posted, and would need to be done for every app you use.
I believe we will have to wait for root access to disable the gesture altogether.
Click to expand...
Click to collapse
Okay, thanks anyways.. sorry for wasting your time.
Have a great day
Beekitu said:
Okay, thanks anyways.. sorry for wasting your time.
Have a great day
Click to expand...
Click to collapse
Not a problem. If a solution is found, it will be posted on this thread.
hi, i found a fun game for wear os, i installed it on my watch, but i can't turn off the swipe to exit, can anyone help?
mustafamfc said:
hi, i found a fun game for wear os, i installed it on my watch, but i can't turn off the swipe to exit, can anyone help?
Click to expand...
Click to collapse
To disable the swipe gesture, you'll need to decompile and patch the apk. I can't help you with decompiling, but there are a few options on this thread: How to decompile an APK or DEX file on Android platform
Once decompiling is complete, follow the steps posted above. For your convenience, I will post them again here, starting with step 2 in Android Studio:
TacoDeMuerte said:
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
Click to expand...
Click to collapse
TacoDeMuerte said:
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
Click to expand...
Click to collapse
NOTE: You may need to repeat step 3 for any style and theme in the app that you want to disable the swipe gesture on. It doesn't necessarily have to be in the 'dimens.xml' file, but it will be in the 'res' folder. Since this step changes from app to app, you'll need to figure out which changes are necessary on your own. Once you're done, recompile and deploy the modded apk.
TacoDeMuerte said:
To disable the swipe gesture, you'll need to decompile and patch the apk. I can't help you with decompiling, but there are a few options on this thread: How to decompile an APK or DEX file on Android platform
Once decompiling is complete, follow the steps posted above. For your convenience, I will post them again here, starting with step 2 in Android Studio:
NOTE: You may need to repeat step 3 for any style and theme in the app that you want to disable the swipe gesture on. It doesn't necessarily have to be in the 'dimens.xml' file, but it will be in the 'res' folder. Since this step changes from app to app, you'll need to figure out which changes are necessary on your own. Once you're done, recompile and deploy the modded apk.
Click to expand...
Click to collapse
hello, thank you for taking care of me, but I couldn't understand anything from what you said, if it doesn't bother you, if you can do what you are saying on any apk and publish it in the form of a video, I would be very useful, thank you

Categories

Resources