HTML 5 Video on Android 4.2.2 device (Geniatech ATV1220) - Web App Development

Hello I am trying to build a simple webview.
But I can't get the video to work. It is working when I am using an emulated device with 4.2.2 running but on the actual device (Geniatech ATV1220) I just get a grey videobox and I can't play video at all. It is loading for a second but then it stops.
Here is my Main activity:
Code:
public class MainActivity extends Activity {
public static final String PAGE_URL = "video js website"; //is correct in code - just can't post links
final Activity activity = this;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webview = (WebView) findViewById(R.id.webView);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.setWebViewClient(new WebViewClient(){});
webview.setWebChromeClient(new WebChromeClient(){
public void onProgressChanged(WebView view, int progress){
activity.setTitle("Loading...");
if(progress == 100){
activity.setTitle(R.string.app_name);
}
}
});
webview.loadUrl(PAGE_URL);
}
}
My Manifest where I enable hardware acceleration:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas.android.com/apk/res/android" //+http , just cant post links
package="com.example.androidwebview"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity
android:name="com.example.androidwebview.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
On my virtual device it is running alright. I am using a 4.2.2 device for that too.
But if I install the apk on the box it just opens the website and i see a gray video frame with a play button, that doesn't work. Also the controls are shown and if i fast forward a bit there is this circle loading thing but it doesn't load anything.
Can anyone help me get video to run on this device in my webview?

Related

How to use baksmali/smali?

Noob alert: Would anyone be kind enough to write a quick tutorial on how to use these jar files? I want to learn how to edit xml. I have searched these forums and google, but havent been able to get anywhere.
Code:
java -jar baksmali-0.93.jar -o <output directory> <.dex file, typically classes.dex>
For example: java -jar baksmali-0.93.jar -o out/rogers/dexout/ rogers-classes.dex
java -Xmx512M -jar smali-0.92.jar <output directory from above step> -o <name for new .dex output file>
For example: java -Xmx512M -jar smali-0.92.jar out/rogers/dexout/ new-rogers.dex
First command disassembles the .dex file, second command reassembles it (hopefully after you went in and made some cool changes to some of the .smali files)
Re-read your post, these are not for editing XML files. That is a whole other ball of wax. Most devs are not as interested in making post-build modifications now that the source for everything is available. You can set up a build environment and edit the XML files in plain text before you compile everything. Which is a lot easier than hex editing binary XML files...
Ohsaka said:
Code:
java -jar baksmali-0.93.jar -o <output directory> <.dex file, typically classes.dex>
For example: java -jar baksmali-0.93.jar -o out/rogers/dexout/ rogers-classes.dex
java -Xmx512M -jar smali-0.92.jar <output directory from above step> -o <name for new .dex output file>
For example: java -Xmx512M -jar smali-0.92.jar out/rogers/dexout/ new-rogers.dex
First command disassembles the .dex file, second command reassembles it (hopefully after you went in and made some cool changes to some of the .smali files)
Re-read your post, these are not for editing XML files. That is a whole other ball of wax. Most devs are not as interested in making post-build modifications now that the source for everything is available. You can set up a build environment and edit the XML files in plain text before you compile everything. Which is a lot easier than hex editing binary XML files...
Click to expand...
Click to collapse
I dont think you have to hex-edit them. Theres a tool called AXMLPrinter2.jar that makes xml files into readable ones. I'm sure you can just make your edits and copy and paste that text into a new blank xml file. Credits to jashu for the AXMLPrinter.jar
alritewhadeva said:
I dont think you have to hex-edit them. Theres a tool called AXMLPrinter2.jar that makes xml files into readable ones. I'm sure you can just make your edits and copy and paste that text into a new blank xml file. Credits to jashu for the AXMLPrinter.jar
Click to expand...
Click to collapse
How do you propose to recompile the xml sheet?
I don't think it's a jar btw, pretty sure he made a tar/gz, and a perl script.
mianosm said:
How do you propose to recompile the xml sheet?
I don't think it's a jar btw, pretty sure he made a tar/gz, and a perl script.
Click to expand...
Click to collapse
nah pretty sure its a jar. I'll find the link for you.
right here http://forum.xda-developers.com/showthread.php?t=514412
just did some quick research...im a noob in this field but can anyone make sense of this? http://www.stylusstudio.com/binary_xml.html#
It's going to be quicker and easier to change the values in a hex editor, and as said prior - you aren't going to be able to just put a human readable xml file into an apk and have the phone use it - it's expecting binary, so it would be a pretty neat feat if it took human readable and parsed it and out put it.
mianosm said:
It's going to be quicker and easier to change the values in a hex editor, and as said prior - you aren't going to be able to just put a human readable xml file into an apk and have the phone use it - it's expecting binary, so it would be a pretty neat feat if it took human readable and parsed it and out put it.
Click to expand...
Click to collapse
Yeah I know that, but you should be able to convert to binary and then convert it back to xml format. Problem is on every converter I've used, in the past 5 minutes (just started researching) keeps saying something about not a schema
alritewhadeva said:
Yeah I know that, but you should be able to convert to binary and then convert it back to xml format. Problem is on every converter I've used, in the past 5 minutes (just started researching) keeps saying something about manifest not found.
Click to expand...
Click to collapse
The xml in the templates/updates is currently compiled.
After you use the xml parser it's human readable/editable, but then you would need to recompile it. If you're going to do that, you'd might as well just do it from the source, and even still the color changes are hard coded and need to be changed to your liking.
The decompiled editing, and hex editing is really going to be the easiest/quickest method for color adjustments for now.
I'm surprised Stericson or JF haven't put out an XML compiler yet...
Ohsaka said:
You can set up a build environment and edit the XML files in plain text before you compile everything. Which is a lot easier than hex editing binary XML files...
Click to expand...
Click to collapse
Is it required to set up a build environment? I researched that and only found instructions for linux/mac.
This is my understanding of baksmali/smali. I thought I could take a file(apparently a DEX file) from the Android SDK, disassemble it, edit, then assemble. I scanned through the SDK and didn't find any DEX files?
Ohsaka said:
I'm surprised Stericson or JF haven't put out an XML compiler yet...
Click to expand...
Click to collapse
yea...True true. Just a QQ what's the AndroidManifest.xml file used for?
For your reading pleasure (from the launcher AndroidManifest.xml):
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, The Android Open Source Project
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher"
android:sharedUserId="android.uid.shared"
android:sharedUserLabel="@string/application_name">
<permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_install_shortcut"
android:description="@string/permdesc_install_shortcut" />
<permission
android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_uninstall_shortcut"
android:description="@string/permdesc_uninstall_shortcut"/>
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_read_settings"
android:description="@string/permdesc_read_settings"/>
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_write_settings"
android:description="@string/permdesc_write_settings"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
android:name="LauncherApplication"
android:process="android.process.acore"
android:label="@string/application_name"
android:icon="@drawable/ic_launcher_home">
<activity
android:name="Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
android:screenOrientation="nosensor"
android:windowSoftInputMode="stateUnspecified|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
android:name="WallpaperChooser"
android:label="@string/pick_wallpaper"
android:icon="@drawable/ic_launcher_gallery">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Enable system-default search mode for any activity in Home -->
<meta-data
android:name="android.app.default_searchable"
android:value="*" />
<!-- Intent received used to install shortcuts from other applications -->
<receiver
android:name=".InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
android:name=".UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
android:name="LauncherProvider"
android:authorities="com.android.launcher.settings"
android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
</application>
</manifest>
Or the Music one:
Code:
packages/apps/Music/res/layout/statusbar.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView android:id="@+id/icon"
android:padding="4dip"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ImageView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/trackname"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:focusable="true"
android:ellipsize="marquee"
android:singleLine="true"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="@+id/artistalbum"
android:textAppearance="?android:attr/textAppearanceSmallInverse"
android:layout_gravity="left"
android:maxLines="2"
android:scrollHorizontally="true"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
And for the statusbar:
Code:
/frameworks/base/tests/StatusBar$ cat AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.statusbartest">
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.VIBRATE" />
<application>
<activity android:name="StatusBarTest" android:label="_StatusBar">
<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>
</activity>
<activity android:name="NotificationTestList" android:label="_Notifications">
<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>
</activity>
<activity android:name="ToastTest" android:label="_Toasts">
<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>
</activity>
<activity android:name="PowerTest" android:label="_Power">
<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>
</activity>
</application>
</manifest>
mianosm said:
For your reading pleasure (from the launcher AndroidManifest.xml):
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, The Android Open Source Project
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher"
android:sharedUserId="android.uid.shared"
android:sharedUserLabel="@string/application_name">
<permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_install_shortcut"
android:description="@string/permdesc_install_shortcut" />
<permission
android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_uninstall_shortcut"
android:description="@string/permdesc_uninstall_shortcut"/>
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_read_settings"
android:description="@string/permdesc_read_settings"/>
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_write_settings"
android:description="@string/permdesc_write_settings"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
android:name="LauncherApplication"
android:process="android.process.acore"
android:label="@string/application_name"
android:icon="@drawable/ic_launcher_home">
<activity
android:name="Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
android:screenOrientation="nosensor"
android:windowSoftInputMode="stateUnspecified|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
android:name="WallpaperChooser"
android:label="@string/pick_wallpaper"
android:icon="@drawable/ic_launcher_gallery">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Enable system-default search mode for any activity in Home -->
<meta-data
android:name="android.app.default_searchable"
android:value="*" />
<!-- Intent received used to install shortcuts from other applications -->
<receiver
android:name=".InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
android:name=".UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
android:name="LauncherProvider"
android:authorities="com.android.launcher.settings"
android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
</application>
</manifest>
Click to expand...
Click to collapse
Is that directly from the source? Android source that is. In eclipse when you write the .xml file doesn't it convert it to binary when you compile/create the app?
That's directly from the source yes. When it's compiled it takes the xml format and turns it into binary yes.
ultra spikey said:
Is it required to set up a build environment? I researched that and only found instructions for linux/mac.
This is my understanding of baksmali/smali. I thought I could take a file(apparently a DEX file) from the Android SDK, disassemble it, edit, then assemble. I scanned through the SDK and didn't find any DEX files?
Click to expand...
Click to collapse
I believe, for right now, you need a build environment to product compiled XMLs only. Until someone releases a tool to compile them...
Your understanding is correct. The SDK does not include and .dex files. The SDK is to help you develop your own app, not edit the underlying android platform files. Even if you grab the source from using git, you wont find .dex files. They are the output of the build process...i.e. the compiled java files...
Yes, only on linux/mac. Just get VMWare or some other virtual machine program and make a linux VM to develop on. If I ever get around to finishing mine, I will give it out so that people can just get VMPlayer to run it...
VirtualBox is pretty outstanding as well as vmware.
The real fix should not be decompiling/compiling though, it really should be edits to the actual source that is pushed upstream to gerrit, so it can be reviewed and updated accordingly.
It's really kind of a sloppy backward way to do it the way how it's getting done right now - don't get me wrong it works, but it's just not best practice.
Taking anything outside of the compiled xml and dex files opens up the system for slowdowns though doesn't it?
Like if we all somehow submitted a patch to the core that made it know to look at /sdcard/theme/ for a bunch of xml files and pngs... Then joe blow comes along with his $2.99 2gig card that runs slow as s* and his whole phone because unusable...
Is it even possible to use eclipse on ubuntu? Haven't found an answer. Running ubuntu on a VM right now.
Eclipse is java... so yes. There may not be a nice windows installer for it, but it should run on any platform with a JRE...
Ohsaka said:
Eclipse is java... so yes. There may not be a nice windows installer for it, but it should run on any platform with a JRE...
Click to expand...
Click to collapse
all right then. Time to research lol. Thanks

[Q] Noob developer need help.

Im writing my first app, and right off the start, when creating a new project in eclipse, I get 2 errors in the manifest.
this is my manifest, note that I didn't change anything. The line of *'s is where eclipse gives me the error. It says;
"no resource identifier found for attribute 'allowBackup' in package 'android' ... line 11"
"no resource identifier found for attribute 'tragetSdkVersion' in package 'android' ... line 7"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk ****************************************************************************************
android:minSdkVersion="3"
android:targetSdkVersion="3" />
<application ****************************************************************************************
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.helloworld.HelloWorld"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
thanks in advance!

[Guide] Make your own watch faces [23-1-2015]

Hello everyone, I've made a simplified tutorial to make your own watchface widget.
In this update I made simpler source code that simplified some steps.
Thanks to xda for posting it in xda Portal
Requirements:
-Eclipse
-Android SDK
-Sony Add-on SDK
Click to expand...
Click to collapse
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------​
1-Download the samples.
2-Extract the zip.
3-Copy the both extracted folders to: "android-sdks\add-ons\addon-sony_add-on_sdk_3_0-sony-19\samples\SmartExtensions".
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4-Open Eclipse and press Ctrl+N, open "Android" and choose "Android Sample Project".
5-Choose "Sony Add-on SDK 3.0".
6-Choose "SmartExtensions > SmartExtensionAPI" and press Finish.
7-Repeat step 4 to 5, choose "SmartExtensions > SmartExtensionUtils" and press Finish.
8-Repeat step 4 to 5, choose "SmartExtensions > ClockWidgetAnalog" if you wanna make an analog clock. or "SmartExtensions > ClockWidgetDigitalList" if you need to make a digital clock. For example, I'll choose the analog clock.
9-Press Finish
10-Now your workspace should looks like this:
11-To rename the project right click on it like this image:
12-Give it any name you want
13-To rename application package right click like this image:
14-Go to: res/values/strings.xml
15-Change these strings and press Ctrl+S to save it.
-You can keep the 'more apps" link if you want. It go to the watch faces collection thread.
-It's optional to add your email, and here's how to remove "Contact me" button:
-Go to res/layout/activity_preference.xml and find this:
Code:
<Button
android:id="@+id/emailBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="[COLOR="Red"]visible[/COLOR]"
android:text="@string/email_btn"/>
-Then change the text marked with red above to "gone". So it will be like this:
Code:
<Button
android:id="@+id/emailBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="[COLOR="Red"]gone[/COLOR]"
android:text="@string/email_btn"/>
16-Change the graphical resources change files in res/drawable-nodpi
17-Connect you device to the pc
18-Enable USB debugging on your phone
19-Right click on the project > Run As > Android application
20-If you want to share the apk you'll find it in the project bin
21-Enjoy
-----------------------------------------------------------------------------------------------------------------------​
How To Resize:
1-Go to "AnalogClock.java" or "DigitalClockLevelList.java in src/-package name-.widgets
2-Edit the marked in red below:
Code:
@Override
public int getWidth() {
return getCellWidth() * [COLOR="Red"]5[/COLOR];
}
@Override
public int getHeight() {
return getCellHeight() * [COLOR="Red"]5[/COLOR];
}
-----------------------------------------------------------------------------------------------------------------------​
How To Add Date:
1-Create new xml file in "res/layout" and give it any name you want
2-Add this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1" >
[COLOR="RoyalBlue"]<com.sonyericsson.extras.liveware.aef.widget.TimeLayout[/COLOR]
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="[COLOR="DarkOrange"]@android:color/white[/COLOR]"
widgets:textSize="[COLOR="Lime"]25[/COLOR]px"
widgets:timeType="[COLOR="Red"]days_of_month[/COLOR]" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
</RelativeLayout>
3-You can change the text marked in red above to:
-"days_of_week"
-"days_of_month"
-"days_of_year"
-"months"
4-You can change the number marked in green above to any number you want, to set the font size. Please notice that the unit must be "px" and do not use "dp".
5-You can change on the text marked in orange "white" to "black", or you can remove all the text in orange and put any hex color code. For example:
android:textColor="#ffbf00"
6-To change the position of it, add under "<com.sonyericsson.extras.liveware.aef.widget.TimeLayout" which is marked in blue above:
-android:layout_centerInParent="true" to put it in the center.
-android:layout_centerHorizontal="true" to put it center in horizontal.
-android:layout_centerVertical="true" to put it center in vertical.
-android:layout_alignParentRight="true" to move it to right side.
-android:layout_alignParentLeft="true" to move it to left side.
-android:layout_alignParentTop="true" to move it to to the top.
-android:layout_alignParentBottom="true" to move it to the buttom.
-android:layout_marginRight="10px" change "10" to any number.
-android:layout_marginLeft="10px" change "10" to any number.
-android:layout_marginTop="10px" change "10" to any number.
-android:layout_marginBotton="10px" change "10" to any number.
7-At last, we must include the date xml on the main watch layout xml which is called on my samples "clock_widget_analog.xml" on analog and "clock_widget_levellists.xml" on the digital clock. For example, if you named the xml you made "date.xml" we will add the text marked in red below:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/watchface_bg" />
[COLOR="Red"]<include layout="@layout/date" />[/COLOR]
<include layout="@layout/analog_clock_hand_hours_border" />
<include layout="@layout/analog_clock_hand_minutes_border" />
<include layout="@layout/analog_clock_hand_seconds" />
</RelativeLayout>
-----------------------------------------------------------------------------------------------------------------------​
How To Reorder:
1-Open the main layout xml, -"clock_widget_analog.xml" on analog and "clock_widget_levellists.xml" on the digital clock-. For example, I'll work on analog.
2-You can remove text that start with "<!--" and end with "-->" like the marked in red . it's just notes from sony.This will make it easier:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/watchface_bg" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->[/COLOR]
<include layout="@layout/analog_clock_hand_hours_border" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->[/COLOR]
<include layout="@layout/analog_clock_hand_minutes_border" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->[/COLOR]
<include layout="@layout/analog_clock_hand_seconds" />
</RelativeLayout>
3-Now you can reorder lines that start with "<include layout="
-----------------------------------------------------------------------------------------------------------------------​
Multiple WatchFace In One App:
-First example is to add digital clock to analog:
1-Copy xml and png files in res/layout and res/drawable-nodpi from digital to analog
2-Copy "DigitalClockLevelList.java" on src/-package name-.widgets from digital to analog
3-Open "ClockWidgetRegistrationInformation" in src/-package name-/ and search for: WidgetClassList widgetList = new WidgetClassList();
4-Add this under WidgetClassList widgetList = new WidgetClassList();:
widgetList.add(DigitalClockLevelList.class);
The text marked in red is same file name you've copied in step 2
5-Now Eclipse will underline it in red as error, it will give you a list of fixes, choose first fix
-Second example if you want to make 2 or more analog watchfaces:
1-Go to res/layout and duplicate all except "activity_preferences.xml", you can rename the duplicated xmls for example by adding "2"
2-Duplicate "AnalogClock.java" in src/-package name-.widgets
3-Add graphical resources on res/drawable-nodpi/ and give it the same names but with "_2"
4-Add the following lines to res/values/strings.xml:
Code:
<string name="name_1">Analog 1</string>
<string name="name_2">Analog 2</string>
To be like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- No translation of sample extensions -->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">Analog clock widget</string>
<string name="preference_info">Analog clock watchface widget for Sony SmartWatch2\nDeveloped by Naheel Azawy\nVersion 1.0</string>
[COLOR="Red"]<string name="name_1">Analog 1</string>
<string name="name_2">Analog 2</string>[/COLOR]
</resources>
5-Edit "AnalogClock2.java" in src/-package name-.widgets from:
Code:
package com.naheel.sw2.widget.example.analog.widgets;
import com.naheel.sw2.widget.example.analog.R;
/**
* This widget displays an analog clock providing resources which will be
* automatically rotated by the accessory firmware to reflect the time.
*/
public class AnalogClock2 extends SmartWatch2ClockWidget {
public AnalogClock2(WidgetBundle widgetBundle) {
super(widgetBundle);
}
@Override
int getWidgetLayout() {
return R.layout.[COLOR="Red"]clock_widget_analog[/COLOR];
}
@Override
public int getName() {
return R.string.[COLOR="Red"]app_name[/COLOR];
}
@Override
public int getWidth() {
return getCellWidth() * 5;
}
@Override
public int getHeight() {
return getCellHeight() * 5;
}
@Override
public int getPreviewUri() {
return R.drawable.[COLOR="Red"]watchface_analog_preview[/COLOR];
}
}
To:
Code:
package com.naheel.sw2.widget.example.analog.widgets;
import com.naheel.sw2.widget.example.analog.R;
/**
* This widget displays an analog clock providing resources which will be
* automatically rotated by the accessory firmware to reflect the time.
*/
public class AnalogClock2 extends SmartWatch2ClockWidget {
public AnalogClock2(WidgetBundle widgetBundle) {
super(widgetBundle);
}
@Override
int getWidgetLayout() {
return R.layout.[COLOR="Red"]clock_widget_analog_2[/COLOR];
}
@Override
public int getName() {
return R.string.[COLOR="Red"]name_2[/COLOR];
}
@Override
public int getWidth() {
return getCellWidth() * 5;
}
@Override
public int getHeight() {
return getCellHeight() * 5;
}
@Override
public int getPreviewUri() {
return R.drawable.[COLOR="Red"]watchface_analog_preview_2[/COLOR];
}
}
6-Edit "clock_widget_analog_2.xml" on res/layout from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/[COLOR="Red"]watchface_bg[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_hours_border[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_minutes_border[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_seconds[/COLOR]" />
</RelativeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/[COLOR="Red"]watchface_bg_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_hours_border_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_minutes_border_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_seconds_2[/COLOR]" />
</RelativeLayout>
7-Edit "analog_clock_hand_seconds_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a second hand using a drawable and setting the timeType to
seconds. The second hand will be automatically rotated by the accessory
firmware. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]second_00[/COLOR]"
widgets:timeType="seconds" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a second hand using a drawable and setting the timeType to
seconds. The second hand will be automatically rotated by the accessory
firmware. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]second_00_2[/COLOR]"
widgets:timeType="seconds" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
8-Edit "analog_clock_hand_minutes_border_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a minute hand using a drawable and setting the timeType to
minutes. The minute hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]minute_border_00[/COLOR]"
widgets:timeType="minutes" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a minute hand using a drawable and setting the timeType to
minutes. The minute hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]minute_border_00_2[/COLOR]"
widgets:timeType="minutes" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
9-Edit "analog_clock_hand_hours_border_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines an hour hand using a drawable and setting the timeType to
hours_fine. The hour hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]hour_border_00[/COLOR]"
widgets:timeType="hours_fine" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines an hour hand using a drawable and setting the timeType to
hours_fine. The hour hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]hour_border_00_2[/COLOR]"
widgets:timeType="hours_fine" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
-----------------------------------------------------------------------------------------------------------------------
---Old thread---
-----------------------------------------------------------------------------------------------------------------------
Please do not take everything and say it's you'r own job. It's enough to say thanks to me on your app. There's something in this world called google removal
Click to expand...
Click to collapse
If you made a watch, post it here and I'll add it to the collection​
Hello,
Thank you very much for your Tutorial. I got my own analog clock.
But is there any way to have a background for Digital Clock?
8-Edit "analog_clock_hand_minutes_border_2.xml" from
dont have analog_clock_hand_minutes_border_2.xml !
---------- Post added at 02:53 PM ---------- Previous post was at 02:47 PM ----------
my watch faces
Hi,
Is it still possible to create new watch faces for the SW2 these days? The main obstacle to start seems to be the inability to download the Sony Add-on SDK. I have only been able to find version 1.0 so far with much searching. Does anyone know where the version 3 file can be downloaded?
Thanks,
Lee

LG Game Pad on Surface Duo

I was able to get a hold of the LG Game Pad apk but I'm unable to get it to install so I wanted to put it here if anyone wants to take a crack at getting it installed.
Game Pad APK:
https://drive.google.com/file/d/1H0hpGShg43uH5ORicvqbYE815R_LCy9d/view?usp=sharing
or here is the full LG Velvet Apps backup (2.5gb):
https://drive.google.com/file/d/10gwZ3CKxyqckgoo2FN4oB8IW1LAQGKme/view?usp=sharing
The install error I am seeing is
[INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Package com.lge.gamepad has no signatures that match those in shared user android.uid.system; ignoring!]
I installed apktool and decoded the app. I assume something needs to changed in the manifest file, but I googled around a bit and I'm out of my depth. For anyone else looking at this thread, here is the manifest.xml:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.system" package="com.lge.gamepad">
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" android:protectionLevel="development|privileged|signature"/>
<meta-data android:name="android.allow_multiple_resumed_activities" android:value="true"/>
<application android:allowBackup="false" android:appComponentFactory="android.support.v4.app.CoreComponentFactory" android:icon="@drawable/lg_iconframe_game" android:label="@string/lg_game_pad" android:maxAspectRatio="2.4" android:resizeableActivity="false" android:supportsRtl="true" android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen">
<activity android:excludeFromRecents="true" android:exported="true" android:name="com.lge.gamepad.GamePadActivity" android:theme="@style/GamePadTheme">
<intent-filter>
<action android:name="com.lge.gamepad.intent.action.START_GAMEPAD"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="com.lge.gamepad"/>
</intent-filter>
</activity>
<meta-data android:name="com.lge.app.forceHideImmersiveConfirm" android:value="true"/>
<meta-data android:name="com.lge.special_display" android:value="true"/>
<service android:exported="true" android:name="com.lge.gamepad.GamePadService">
<intent-filter>
<action android:name="com.lge.gamepad.intent.action.START_GAMEPAD"/>
<action android:name="com.lge.gamepad.intent.action.END_GAMEPAD"/>
<action android:name="com.lge.gamepad.intent.action.START_GAMEPAD_SERVICE_ONLY"/>
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</service>
<provider android:authorities="com.lge.provider.gamepad" android:exported="false" android:name="com.lge.gamepad.database.GamePadProvider"/>
<activity android:configChanges="orientation" android:excludeFromRecents="true" android:exported="false" android:launchMode="singleTop" android:name="com.lge.gamepad.EditorSubActivity" android:taskAffinity="com.lge.gamepad.sub" android:theme="@style/Theme.AppCompat.Light.NoActionBar.Translucent"/>
</application>
</manifest>
Can't wait to see a fully ported version
I am no expert but I would start by changing these two lines:
<meta-data android:name="com.lge.app.forceHideImmersiveConfirm" android:value="true"/>
<meta-data android:name="com.lge.special_display" android:value="true"/>
Maybe try false on both see if that works.
Did anyone get this to work?
Hello any news about?

can't get simple resource replacement to work

Hi,
I'm trying to theme an app I frequently use and as I'm not using a theme engine I thought Xposed would be the easiest way. However with the instructions by rovo89 I can't get it to work, however simple they seem.
The app I'm trying to modify is https://play.google.com/store/apps/details?id=cgeo.geocaching
Below is my AndroidManifest.xml and CgeoGcIcons.java for a simple test: Modify the header string in settings dialog and change the "type_traditional" drawable.
I'm running EdXposed 0.5.1.3_4653 YAFHA. Other modules like Gravitybox are working.
Java:
package xda.xlafbk.cgeogcicons;
import android.content.res.XModuleResources;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
public class CgeoGcIcons implements IXposedHookZygoteInit, IXposedHookInitPackageResources {
private static String MODULE_PATH = null;
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
}
@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("cgeo.geocaching"))
return;
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("cgeo.geocaching", "string", "settings_titlebar", "Test whether this works");
resparam.res.setReplacement("cgeo.geocaching", "drawable", "type_traditional", modRes.fwd(R.drawable.type_traditional));
}
}
XML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xda.xlafbk.cgeogcicons"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="29"
android:targetSdkVersion="30" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:extractNativeLibs="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.CgeoGCIcons" >
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="c:geo icon theme" />
<meta-data
android:name="xposedminversion"
android:value="53" />
</application>
</manifest>
Unfortunately...
https://github.com/ElderDrivers/EdXposed/commit/b1bc7200a6d351d208d33336257a709877932bc2
I have resource hooking enabled of course. And am on android 10
XlAfbk said:
I have resource hooking enabled of course. And am on android 10
Click to expand...
Click to collapse
It doesn't matter, resource hooking is disabled in the core of edxposed, as you can see in the commit's link above, and "Resources hooking might has been broken since Q" (android 10).
And:
https://github.com/ElderDrivers/EdXposed/issues/791
That commot changes only the default value (and the setting is called "enable hooking" instead of disable now). But as you can see also from the referenced issue it's working
XlAfbk said:
That commot changes only the default value (and the setting is called "enable hooking" instead of disable now). But as you can see also from the referenced issue it's working
Click to expand...
Click to collapse
New LSPosed does the job, have a look into it (tried it here and it's working great)!
serajr said:
New LSPosed does the job, have a look into it (tried it here and it's working great)!
Click to expand...
Click to collapse
I've already tried lsposed and in general it's working but the above code still doesn't do anything.
Hi, I ran into the same problem on android 11. Any updates?
ServOKio said:
Hi, I ran into the same problem on android 11. Any updates?
Click to expand...
Click to collapse
I'm no longer using this but looking at my git commit history it seems I got it working after all, probably with LSposed as that's what I've been using since it came into existence.
package xda.xlafbk.cgeogcicons;
import android.content.res.XModuleResources;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources;
public class CgeoGcIcons implements IXposedHookZygoteInit, IXposedHookInitPackageResources {
private static String MODULE_PATH = null;
@Override
public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
}
@Override
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("cgeo.geocaching")) { return; }
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("cgeo.geocaching", "drawable", "type_advlab", modRes.fwd(R.drawable.type_advlab));
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xda.xlafbk.cgeogcicons">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.CgeoGCIcons">
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="c:geo icon theme" />
<meta-data
android:name="xposedminversion"
android:value="93" />
</application>
</manifest>

Categories

Resources