[MOD][HOWTO][v2] change ICS lockscreen animation to Honeycomb style (ripple) - Android Themes

New Version : much more honeycomb-like version
preview :
{
"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"
}
howto :
framework.jar
1) line 72~ : change animation speed.
Code:
// Tune-able parameters
private static final int CHEVRON_INCREMENTAL_DELAY = [B][COLOR="Blue"]800[/COLOR][/B];
private static final int CHEVRON_ANIMATION_DURATION = [B][COLOR="Blue"]4000[/COLOR][/B];
private static final int RETURN_TO_HOME_DELAY = 1200;
private static final int RETURN_TO_HOME_DURATION = 300;
2) line 305~ :
Code:
private void startChevronAnimation() {
final float r = mHandleDrawable.getWidth() * 0.4f;
final float chevronAnimationDistance = mOuterRadius * 0.9f;
final float from[][] = {
{mWaveCenterX - r, mWaveCenterY}, // left
{mWaveCenterX + r, mWaveCenterY}, // right
{mWaveCenterX, mWaveCenterY - r}, // top
{mWaveCenterX, mWaveCenterY + r} }; // bottom
final float to[][] = {
{mWaveCenterX - chevronAnimationDistance, mWaveCenterY}, // left
{mWaveCenterX + chevronAnimationDistance, mWaveCenterY}, // right
{mWaveCenterX, mWaveCenterY - chevronAnimationDistance}, // top
{mWaveCenterX, mWaveCenterY + chevronAnimationDistance} }; // bottom
mChevronAnimations.clear();
final float startScale = 0.5f;
final float endScale = 2.0f;
for (int direction = 0; direction < 4; direction++) {
for (int count = 0; count < mFeedbackCount; count++) {
to
Code:
private void startChevronAnimation() {
final float r = mHandleDrawable.getWidth() * 0.4f;
final float chevronAnimationDistance = mOuterRadius * 0.9f;
final float from[][] = {
{mWaveCenterX - r, mWaveCenterY}, // left
[B][COLOR="blue"]{mWaveCenterX, mWaveCenterY}, // right[/COLOR][/B]
{mWaveCenterX, mWaveCenterY - r}, // top
{mWaveCenterX, mWaveCenterY + r} }; // bottom
final float to[][] = {
{mWaveCenterX - chevronAnimationDistance, mWaveCenterY}, // left
[B][COLOR="blue"]{mWaveCenterX, mWaveCenterY}, // right[/COLOR][/B]
{mWaveCenterX, mWaveCenterY - chevronAnimationDistance}, // top
{mWaveCenterX, mWaveCenterY + chevronAnimationDistance} }; // bottom
mChevronAnimations.clear();
[B][COLOR="blue"]final float startScale = 0.3f;
final float endScale = 1.1f;[/COLOR][/B]
for (int direction = 0; direction < 4; direction++) {
for (int count = 0; count < mFeedbackCount; count++) {
you can change these values to your taste.
framework-res.apk
download resources (PNGs - WVGA only) :
http://www.mediafire.com/?ksnc84d04w96uv8
1) decompile framework-res.apk
2) delete /res/drawable/ic_lockscreen_outerring.xml
3) add resource PNGs to /res/drawable-****/
4) open /layout/keyguard_screen_tab_unlock.xml
from :
Code:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="302.0dip">
<com.android.internal.widget.multiwaveview.MultiWaveView android:orientation="horizontal" android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" android:directionDescriptions="@array/lockscreen_direction_descriptions" android:targetDrawables="@array/lockscreen_targets_with_camera" android:handleDrawable="@drawable/ic_lockscreen_handle" android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right" android:waveDrawable="@drawable/ic_lockscreen_outerring" android:outerRadius="@dimen/multiwaveview_target_placement_radius" android:hitRadius="@dimen/multiwaveview_hit_radius" android:vibrationDuration="20" android:snapMargin="@dimen/multiwaveview_snap_margin" android:feedbackCount="3" android:verticalOffset="60.0dip" android:horizontalOffset="0.0dip" />
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" />
</RelativeLayout>
to
Code:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="[COLOR="Blue"]332.0dip[/COLOR]">
<com.android.internal.widget.multiwaveview.MultiWaveView android:orientation="horizontal" android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" android:directionDescriptions="@array/lockscreen_direction_descriptions" android:targetDrawables="@array/lockscreen_targets_with_camera" android:handleDrawable="@drawable/ic_lockscreen_handle" android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right" android:waveDrawable="@drawable/ic_lockscreen_outerring" android:outerRadius="@dimen/multiwaveview_target_placement_radius" android:hitRadius="@dimen/multiwaveview_hit_radius" android:vibrationDuration="20" android:snapMargin="@dimen/multiwaveview_snap_margin" android:feedbackCount="[COLOR="Blue"]5[/COLOR]" android:verticalOffset="[COLOR="blue"]0.0dip[/COLOR]" android:horizontalOffset="0.0dip" />
<TextView [COLOR="blue"]android:visibility="gone"[/COLOR] android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" />
</RelativeLayout>
- remove carrier text is not essential..
5) open /res/values/arrays.xml :
from :
Code:
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
<item>@null</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
<array name="lockscreen_target_descriptions_with_camera">
<item>@string/description_target_unlock</item>
<item>@null</item>
<item>@string/description_target_camera</item>
<item>@null</item>
</array>
to:
Code:
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
</array>
<array name="lockscreen_target_descriptions_with_camera">
<item>@string/description_target_unlock</item>
</array>
6) open /res/values/dimens.xml
from :
Code:
<dimen name="keyguard_lockscreen_outerring_diameter">270.0dip</dimen>
<dimen name="multiwaveview_target_placement_radius">135.0dip</dimen>
to :
Code:
<dimen name="keyguard_lockscreen_outerring_diameter">220.0dip</dimen>
<dimen name="multiwaveview_target_placement_radius">120.0dip</dimen>
7) recompile.
-----------------------------------------------------------------------------
Previous version :
this mod was originally posted in Nexus S theme forum.
[MOD][IMM26] change ICS lockscreen animation to honeycomb style
at first, i don't have any intention to write guide for this mod because i think the method is too stupid ..
but many people requested it so i wrote this simple guide.
-----------------------------------------------------------------------------
firstly, you have to edit lockscreen animation related code.
platform_frameworks_base/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
1) line 72~
Code:
// Tune-able parameters
private static final int CHEVRON_INCREMENTAL_DELAY = 160;
private static final int CHEVRON_ANIMATION_DURATION = 850;
private static final int RETURN_TO_HOME_DELAY = 1200;
private static final int RETURN_TO_HOME_DURATION = 300;
to
Code:
// Tune-able parameters
private static final int CHEVRON_INCREMENTAL_DELAY = [B][COLOR="Blue"]480[/COLOR][/B];
private static final int CHEVRON_ANIMATION_DURATION = [B][COLOR="Blue"]3000[/COLOR][/B];
private static final int RETURN_TO_HOME_DELAY = 1200;
private static final int RETURN_TO_HOME_DURATION = 300;
2) line 305~ : same as above guide (new version).
-----------------------------------------------------------------------------
themes
: you have to replace lockscreen related PNGs in framework-res.apk.
framework-res.apk/res/drawable-hdpi or mdpi or xhdpi...
- ic_lockscreen_chevron_down.png
- ic_lockscreen_chevron_left.png
- ic_lockscreen_chevron_right.png (important)
- ic_lockscreen_chevron_up.png
and if you want, change lockscreen handle too.
- ic_lockscreen_handle_normal.png
- ic_lockscreen_handle_pressed.png
all my works are here (for hdpi).
1) default honeycomb ripple : http://www.mediafire.com/?7ktduz5dhsmzq6p
2) chrome logo :
download : http://www.mediafire.com/?osjng768zznfeh6
3) android logo
download : http://www.mediafire.com/?56sjs541bij3ygu
4) AT Field style (octagonal ripple)
download : http://www.mediafire.com/?t8lrdkr23nex7pc
5) Google Play logo
download : http://www.mediafire.com/?1vbc3ctdc7p94j4
-----------------------------------------------------------------------------
Bonus : wallpapers in preview videos
chrome logo (in first video) : [WALLPAPER] chrome logo wallpaper
modified phasebeam (in video 2, 3 and 4): [LWP] themed Phasebeam live wallpaper (4 versions)
Google Play logo (video 5) : [WALLPAPER] Google Play logo wallpaper

Thank you my friend....This is awesome!!!

question, since I always have to do things the hard way, in method one, what are you using to decompile and edit the jar? I had already found the timing part, but can't find the positioning.
Sent from my Nexus S 4G

shane6374 said:
question, since I always have to do things the hard way, in method one, what are you using to decompile and edit the jar? I had already found the timing part, but can't find the positioning.
Click to expand...
Click to collapse
i think compiling from source is much easier than editing smali file..
https://github.com/android/platform...ernal/widget/multiwaveview/MultiWaveView.java

Tnx!
Thanks Dude! Ill definitely get my hand over the Thanks button I'm gonna try it soon, when I have time

evilisto said:
i think compiling from source is much easier than editing smali file..
https://github.com/android/platform...ernal/widget/multiwaveview/MultiWaveView.java
Click to expand...
Click to collapse
Thanks, but i dont have the option to compile from source, but would like this edit... i am not on a AOKP, AOSP OR CM9 rom... any chance you could give me the actual lines to edit please? Would be much appreciated...
Sent from my Transformer TF101 using XDA Premium HD app
EDIT: Ok, I compared the two files, and well, there are many many differences in the edited one that you have provided. I will try to include that in my framework.jar and see how I get on there!
Thanks for your work here anyway!

Any way you can make flashable zip for the honeycomb ripple for CM9?

mattmanwrx said:
Thanks.
EDIT: Ok, I compared the two files, and well, there are many many differences in the edited one that you have provided. I will try to include that in my framework.jar and see how I get on there!
Thanks for your work here anyway!
Click to expand...
Click to collapse
Hi,
I swopped the multiwave smali file with the one you provided. And swopped over the chevron files from your HC style from the link in the first post, but it isnt centered...
(In fact, firstly it bootlooped, I then flashed a non modified framework.jar (as the one in my /system was already modified for the smoother scrolling and volume hack).
After flashing the non modified then the modified for this mod (including the smoother scrolling within the framework.jar), it booted up fine, but as I say, it isnt centered... Would you know why? attached is screen shots taken with ddms.bat

mattmanwrx said:
Hi,
I swopped the multiwave smali file with the one you provided. And swopped over the chevron files from your HC style from the link in the first post, but it isnt centered...
(In fact, firstly it bootlooped, I then flashed a non modified framework.jar (as the one in my /system was already modified for the smoother scrolling and volume hack).
After flashing the non modified then the modified for this mod (including the smoother scrolling within the framework.jar), it booted up fine, but as I say, it isnt centered... Would you know why? attached is screen shots with ddms.bat
Click to expand...
Click to collapse
Sorry but that sort of looks badass in the second picture..hahahaha Hope you get it working, is badass, I love it!!

mattmanwrx said:
Hi,
I swopped the multiwave smali file with the one you provided. And swopped over the chevron files from your HC style from the link in the first post, but it isnt centered...
(In fact, firstly it bootlooped, I then flashed a non modified framework.jar (as the one in my /system was already modified for the smoother scrolling and volume hack).
After flashing the non modified then the modified for this mod (including the smoother scrolling within the framework.jar), it booted up fine, but as I say, it isnt centered... Would you know why? attached is screen shots taken with ddms.bat
Click to expand...
Click to collapse
Although I haven't got this to work for me yet either, after spending some time on this, I would compare the github branch for the rom you are working with with the one he linked to in 4th post and make the edits according to the code boxes in the OP.
The reason it's not centered when you did get it to boot is because the edit in the jar file is what centers it. I tried to both edit the image and center it in the xml file. It worked to a point, but still not good enough.

shane6374 said:
Although I haven't got this to work for me yet either, after spending some time on this, I would compare the github branch for the rom you are working with with the one he linked to in 4th post and make the edits according to the code boxes in the OP.
The reason it's not centered when you did get it to boot is because the edit in the jar file is what centers it. I tried to both edit the image and center it in the xml file. It worked to a point, but still not good enough.
Click to expand...
Click to collapse
Thanks, i will check the two sources and let the thread know the outcome... never actually compiled and dont really have the environment for it...
Sent from my Transformer TF101 using XDA Premium HD app

Two sources are different... may have to look a building the framework.jar from source...
Just a quick question for anyone who is reading...
Would you sign framework.jar (or any system/app) after Modding them? And if so, with what key? The testsign and key which is in with apk manager (that I think was originally from sterricson(I think that is the guy on xda forums))?
Sent from my HTC Desire using xda premium

honeycomb style v2
preview :
i think this is much more similar to honeycomb than previous one..
and of course, far more complex (or annoying? ) to make...
anyway, i'll add this to op later..
mattmanwrx said:
Would you sign framework.jar (or any system/app) after Modding them?
Click to expand...
Click to collapse
you don't have to sign modified framework.jar.

evilisto said:
you don't have to sign modified framework.jar.
Click to expand...
Click to collapse
Thanks, my multiwaveview.smali is not any of the ones you have, and if i use yours its gives me a mismatch signiture for classes.dex @framework...
My multiwaveview is edited (evervolv based rom) and the phone wont boot...
I will need to learn how to compile from source (have edited it in github), so i can use it myself...
Sent from my Transformer TF101 using XDA Premium HD app

could u make a flashable zip for the chrome lover pleeeeeeeeeez?

can someone help me
I've been trying all night to decompile and recompile framework-res.apk but I have been unsuccessful
I always get an error when I recompile
I have a Galaxy Nexus and i'm running AOKP M4

stupid question bcuz it says i can in the OP.. can i use this on my stock ota 4.0.2/icl53f ??

evilisto said:
preview :
i think this is much more similar to honeycomb than previous one..
and of course, far more complex (or annoying? ) to make...
anyway, i'll add this to op later..
you don't have to sign modified framework.jar.
Click to expand...
Click to collapse
It sounds great and hoping it will appear on AOKP

h_zee13 said:
can someone help me
I've been trying all night to decompile and recompile framework-res.apk but I have been unsuccessful
I always get an error when I recompile
I have a Galaxy Nexus and i'm running AOKP M4
Click to expand...
Click to collapse
Can u tell us what your error is? It may help
Sent from my HTC Desire using xda premium

is there a way to force wakeup to go to this screen instead of my password unlock? got exchange mail and i need to have either pw or pin.
thanks!

Related

Development team V2

Hello everyone,
I want to start again with a development team. After miroslav decided to finish the project on his own, I want to try it again. But this time with a real team Only with people who want to participate, and not just type make. Who wants to join?
miroslav_mm said:
So, I opened your eyes and showed real face our "superstar"!?
Ok! Let's stop this stupid discussion and continuous develop ROM.
At this moment I have main part:
Torchscreen +
BT (BT-calling) +
WiFi (need to test) +
Sensor +
GSM (Waiting call) +
Mobile Data +
Audio +
Vibrate +
HW + 3D ??? (need new kernel or port new 3D kernel driver (kgsl) (in progress))
usb storage ??? (only with special app (native in progress))
Camera ??? (in progress)
Video codec ??? (in progress)
Anyone doing something? Maybe fix some stuff?
Click to expand...
Click to collapse
He just want to clean his topic. Send him a PM.
I understand that but there is still no team. He just made his project open for patches. And I think, personally, a team could help the speed on development of a ROM So please join
Sent from my GT540 using Tapatalk
So join his team , and start patching?
wwenigma said:
So join his team , and start patching?
Click to expand...
Click to collapse
Since when does he have a team? What I know about it, is that he just made some kind of open-source project where you can add your own updates and where he gets no credit.
Sent from my GT540 using Tapatalk
I can help you with Java stuff!
I think miroslav_mm wants to release ICS under name of SWIFT-TEAM, with developer names in credits.... may you ask him about it?
Do not split guys...
Miroslav said that it's only him on the team...so i don't see any team there..if we are more than 1 guy in a team we can get faster a daily ROM for our Phones
rexes13 said:
Miroslav said that it's only him on the team
Click to expand...
Click to collapse
Jep, because PCF+MGP join then leave and jasper580 cant make neccessary steps... ask him. All two, ask him about it.
wwenigma said:
Jep, because PCF+MGP join then leave and jasper580 cant make neccessary steps... ask him. All two, ask him about it.
Click to expand...
Click to collapse
I can make nesseccary steps if I want, but I don't want to. I want to start cleaned up. That's why I created this topic. So:
If you want to join: welcome.
If you don't want to: stop spamming
@rexes13 Welcome to the team!
Sent from my GT540 using Tapatalk
Good news.
Yesterday I successfully ported 3d kernel driver (kgsl) from 35, so now we have full functionality kernel with OpenGL ES-CM 1.1.
So HW, 3D and other stuff with support OpenGL working, not excellent but working, need improve source code Surfaceflinger and HardwareDisplay.
Maybe next weak I will make new thread and publish first public test version, but all development moments we can discus here.
Before I need redownload all sources CM9 again. Yesterday I had the same error like in wwenigma and aaa801
Code:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/power/power.c
arm-linux-androideabi-gcc: ": No such file or directory
<command-line>: warning: missing terminating " character
and I dont know WTF, so delete all source tree. Maybe today will try download again and build again.
hell yeah! im just another non-dev member LOL sry
Need help!
Look on code:
Code:
//static int32_t msm_tscal_scaler = 65536;
static int32_t msm_tscal_xscale = 70046;
static int32_t msm_tscal_xoffset = -4191987;
static int32_t msm_tscal_yscale = 71735;
static int32_t msm_tscal_yoffset = -3004437;
this pointers for torch 320*240. So when I using that I need tap on 2mm high on icon for open something. This pointer need for screen calibration. Need find right pointer.
I can't find a logic in this numbers.
miroslav_mm said:
Need help!
Look on code:
Code:
//static int32_t msm_tscal_scaler = 65536;
static int32_t msm_tscal_xscale = 70046;
static int32_t msm_tscal_xoffset = -4191987;
static int32_t msm_tscal_yscale = 71735;
static int32_t msm_tscal_yoffset = -3004437;
this pointers for torch 320*240. So when I using that I need tap on 2mm high on icon for open something. This pointer need for screen calibration. Need find right pointer.
I can't find a logic in this numbers.
Click to expand...
Click to collapse
The offsets appear to have a ~4:3 ratio. It doesn't make sense though why it's x:y=4:3, and not the other way around, since the screen is usually 3:4(e.g. 320x480 or 240x320). Also, considering our screen is 320x480, which is a ratio of 1,5 and not 1,(3), I think those would be totally wrong for our phone. Maybe try to modify one of the two to match 1,5 ratio. E.g. make xoffset=-4506655. I don't know. :/
Please discuss development on your page. I want to make a dev team here
Sent from my GT540 using Tapatalk
deleted
10 character
This numbers working with this java code together:
]
Code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Read current values
final int xoffset = (readValue("xoffset")*240+480)/960;
final int yoffset = (readValue("yoffset")*320+460)/920;
final int xscale = readValue("xscale");
final int yscale = readValue("yscale");
view = new View(this) {
private int step = 1;
private int rawx1;
private int rawy1;
private int rawx2;
private int rawy2;
private void writeValue(String parameter, int value) {
try {
FileOutputStream fos = new FileOutputStream(new File("/sys/module/msm_touch/parameters/tscal_" + parameter));
fos.write(String.valueOf(value).getBytes());
fos.flush();
fos.getFD().sync();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (ev.getAction() != MotionEvent.ACTION_UP)
return true;
if(step==1) {
rawx1 = ((int)ev.getRawX()*65536-xoffset+32768)/xscale;
rawy1 = ((int)ev.getRawY()*65536-yoffset+32768)/yscale;
if(rawx1<100 && rawy1<100)
step = 2;
} else if(step==2) {
rawx2 = ((int)ev.getRawX()*65536-xoffset+32768)/xscale;
rawy2 = ((int)ev.getRawY()*65536-yoffset+32768)/yscale;
if(rawx2>140 && rawy2>220)
step = 3;
} else {
int distx = rawx2 - rawx1;
int new_xscale = (140*65536 + distx/2)/distx;
int disty = rawy2 - rawy1;
int new_yscale = (220*65536 + disty/2)/disty;
int new_xoffset = 1;
new_xoffset += 50*65536-rawx1*new_xscale;
new_xoffset += 190*65536-rawx2*new_xscale;
new_xoffset /= 2;
new_xoffset = (new_xoffset*960+120)/240;
int new_yoffset = 1;
new_yoffset += 50*65536-rawy1*new_yscale;
new_yoffset += 270*65536-rawy2*new_yscale;
new_yoffset /= 2;
new_yoffset = (new_yoffset*920+160)/320;
// Pass new calibration to kernel
writeValue("xoffset", new_xoffset);
writeValue("yoffset", new_yoffset);
writeValue("xscale", new_xscale);
writeValue("yscale", new_yscale);
// Save calibraiton data to /data/system/pointercal
StringBuilder sb = new StringBuilder();
sb.append(new_xscale);
sb.append(" ");
sb.append(0);
sb.append(" ");
sb.append(new_xoffset);
sb.append(" ");
sb.append(0);
sb.append(" ");
sb.append(new_yscale);
sb.append(" ");
sb.append(new_yoffset);
sb.append(" ");
sb.append(65536);
App + ui input framework + kernel working together.
App - creation poinercal
ui input framework - reading pointercal send correct info to kernel
kernel touch driver - doing move.
Öhm, the touchscreen driver use a virtual square (320*320) to detect touch, stretched to a rectangle(320*480)?
mod: about calibration, http://code.google.com/p/openeve/issues/detail?id=91
jasper580 said:
Please discuss development on your page. I want to make a dev team here
Click to expand...
Click to collapse
I cant understand you! What do you mean? Do you wanna make new dev team? Working on my sources but without me?
I exactly want to ask that. Maybe he start from scratch, his github is near empty.

XML parsing-best method, general discussion

I am relatively new to programing and have been teaching myself as I go. I am trying to now integrate ESPN's API into my app which outputs XML data. I have done enough research to understand that I need to use an XML parser and that the XML can be displayed as a list view or web view by adding HTML markup.
I would like this thread to become a general discussion for all new developers on what XML parsing is and what it does. How it works, the code behind it etc.
I am currently trying to modify a code snippet from the developer.google.com website.
Android includes built in libraries for XML Parsing.
You can see a minimal use of the library here:
Code:
import java.io.IOException;
import java.io.StringReader;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
public class SimpleXmlPullApp
{
public static void main (String args[])
throws XmlPullParserException, IOException
{
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput( new StringReader ( "<foo>Hello World!</foo>" ) );
int eventType = xpp.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if(eventType == XmlPullParser.START_DOCUMENT) {
System.out.println("Start document");
} else if(eventType == XmlPullParser.START_TAG) {
System.out.println("Start tag "+xpp.getName());
} else if(eventType == XmlPullParser.END_TAG) {
System.out.println("End tag "+xpp.getName());
} else if(eventType == XmlPullParser.TEXT) {
System.out.println("Text "+xpp.getText());
}
eventType = xpp.next();
}
System.out.println("End document");
}
}
So essentially, you can grab the xml from ESPN, save it to a file, parse it with that library, and output as desired.
Full details here: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
the fastest way I know is the parser written in c/c++ and compiled with ndk.
bitpushr said:
Android includes built in libraries for XML Parsing.
So essentially, you can grab the xml from ESPN, save it to a file, parse it with that library, and output as desired.
Full details here: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
Click to expand...
Click to collapse
I will have to try out this code. Because I am learning as I go there are many things in java I don't yet understand which ultimately make it a lot harder to accomplish tasks but I am slowly catching on
If you want to do this in a .NET (Windows x86/64, Windows Mobile, Windows Phone) environment, or a Linux MONO environment then the following will carry out the bare minimum of parsing.
Assuming you have the data in an XML file :- PARAMS.XML in the same folder as the program, created similar to this:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<PARAMS>
<Library>TESTLIB</Library>
<Source>C:\RetData\</Source>
</PARAMS>
Then the following C# code will read and extract the parameters:
Code:
using System.Xml;
string LibName,RetDir;
XmlReader xrdr = XmlReader.Create(Application.StartupPath+"\\PARAMS.xml");
xrdr.ReadToFollowing("Library");
Libname=xrdr.ReadElementContentAsString();
xrdr.ReadToFollowing("Source");
RetDir = xrdr.ReadElementContentAsString();
xrdr.Close();
After executing this code then:
LibName = "TESTLIB"
RetDir = "C:\RetData\"
CAVEAT:
I mentioned that this is the bare minimum. An XmlReader object is a forward only reader. Also, this code has no error checking.
In this case the elements must be read in the order they occur or the reader will encounter a null element and throw an error.

[Q] Change layout from VolumePanel

Hey there,
at the moment I'm trying to create my first Xposed Module. My wish to give the VolumePanel a new look. I found the layout and the code for the VolumePanel in AOSP here:
Code
Layout
Now I want to modify this layout but I can't get it work. I'm not sure in which package the VolumePanel is after the compilation of Android. I tried wit this code here:
Code:
resparam.res.hookLayout("android", "layout", "volume_adjust", new XC_LayoutInflated()
{
@Override
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable
{
Log.d("ME", "Layout infaleted");
LinearLayout ll = new LinearLayout(liparam.view.getContext());
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(liparam.view);
liparam.view = ll;
}
});
If I try it with this code the function is never called. As you can see here I'm trying to wrap the whole layout with a LinearLayout (for the beginning).
I'm also not realy sure if I can call the last line of code and overwrite the variable view. Is that okay or do I have to do it in another way? (but I know that the xml is in the framework-res.apk)
Would be great if you can help me with this: Can I overwrite the view in the way I do and where can I get the packageName of the volumeView?
Kind regards
Cilenco

Piller [ Theme Installer CM 12 ] [ OpenSource ]

Good evening to all boys.
Today I wanted to announce the release of Piller, a Theme Installer for Lollipop, on behalf of pillSoft (Small development team).
Piller uses code as open source, EasyLicenseChecker by Ishida and parts of code Rahul K Dinesh.
We tried to make the 'installer as dynamic as possible, so that they serve a few steps to add themes and customize it.
We decided to to insert the control on the license to meet the needs of young developers who see their apps distributed on the third store.
All this is expressed as a clean graphics, attractive and modern.
We have already translated all strings in Italian !.
We report below changes necessary to customize your installer.
All this information is also given in the description of this project on GitHub.
Screenshoot!
{
"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"
}
Screenshot realized with Italian String .
Personalize and Add Theme:
- Addition of the theme in assets / files, the name of apk must be formed only by the name of the theme **Important**.
- Inclusion of information on the topic in the file arrays.xml this includes:
* Theme Name
* Package Theme
* Motto of the theme
* Color of Primary Theme
* Primary Color of Dark Theme
* Primary Accent Color of Theme
* Highlighted Primary Color of Theme
#Change The name of application
Code:
<string name = "nameApplication"> Piller </ string>
<string name = "app_name"> Piller </ string>
#Customize Toolbar and colors refers to the file Color.xml as:
Code:
<color name = "ColorPrimary"> # 2d5d82 </ color> ToolBar
<color name = "colorPrimaryDark"> # 21425d </ color> StatusBar
<color name = "colorAccent"> # 01bcd5 </ color> AccentColor
#To insert the image of the subject that will appear in the installation window should change some lines of code (look for "Change it for image Theme"):
Code:
switch (auxTheme.theme_name) {
houses "Lin": // Replace Lin with your Theme Name
res = R.drawable.imm; // Replace imm with your image name
break;
houses "Daa": // Replace Lin with your Theme Name
res = R.drawable.imm2; // Replace imm with your image name
}
Also provided are also files that relate to the themes and images placeholder icon, these files can be opened with illustrator,**Located in Graphics Folder**
We hope that this can be d 'help and to your liking, all criticisms are welcome in order to improve the project.
If you want to support us ,you can make a modest donation to the team via paypal.
FAQ:
* I saw Lin and Daa, but are available to download?
- At this moment not, but will be available soon, follow + GiulioFagioli on Google Plus.
* Can I use the installer for profit?
- Yes you can, it would be appreciated ,if you believe, a small donation.
* Can I modify and resell the code / project?
-No, the project is under the GPL, but you can change it, improve it and drop it OpenSource.
* Can I use the 'icon or / and pictures of Placeholder?
- Yes, you can. You can find these file on Graphics folder , the extension is .ai and you can open it with illustrator Cs6 or later..
* How can I stay updated on the development of the project?
- Follow Giulio Fagioli and Lorenzo Salani on Google+ and follow this Thread.
Piller Project on GitHub.
Changelog
Version 1.07:
-Fix bugs
-Added Gallery
Version 1.06:
-Now the preview image of the theme adapts automatically
-it is easier to change the icons of the fab and the size of both
------
-Fix bug (EBUSY)
Version 1.05:
-Added Unistall with same button used for installation
-Add Fab for installation and unistall of theme
-Removed for now the option of going directly to theme chooser
Version 1.04b:
-Add Internet Permission on manifest
-Add Theme engine requirement
-Clean up some part of code
-Change version of Piller
#Allthebest
Sent from my Moto G using Tapatalk
Awesome!
I pondered how to use this app
To add, for example, my theme, I have to recompile the Piller apk. And as a result, the installer will be with 1 my theme, which I'll post in the web. And I will add to it as the theme of manufacturing. And, thus, it will be a kind of application which will be gathered all of my work?
or
Suppose there is one person who will constantly add all existing themes in this app, and also spread to the web.
Maybe someone can explain me for what this application?
LidaFlorida said:
I pondered how to use this app
To add, for example, my theme, I have to recompile the Piller apk. And as a result, the installer will be with 1 my theme, which I'll post in the web. And I will add to it as the theme of manufacturing. And, thus, it will be a kind of application which will be gathered all of my work?
or
Suppose there is one person who will constantly add all existing themes in this app, and also spread to the web.
Maybe someone can explain me for what this application?
Click to expand...
Click to collapse
I think it is for packaged groups of themes - such as "Mono Family for CM11/PA" on store.. allows multiple themes to be distributed as one apk
haydnlj said:
I think it is for packaged groups of themes - such as "Mono Family for CM11/PA" on store.. allows multiple themes to be distributed as one apk
Click to expand...
Click to collapse
It is so.
Piller allows you to distribute multiple themes in one application.
We tried to make it as easy as possible the dynamic addition of themes.
In some installers have to change many pieces of code, and sometimes can be difficult for theme developers that do not know java.
It makes me happy to see people on this thread, thanks again.
LidaFlorida said:
I pondered how to use this app
To add, for example, my theme, I have to recompile the Piller apk. And as a result, the installer will be with 1 my theme, which I'll post in the web. And I will add to it as the theme of manufacturing. And, thus, it will be a kind of application which will be gathered all of my work?
or
Suppose there is one person who will constantly add all existing themes in this app, and also spread to the web.
Maybe someone can explain me for what this application?
Click to expand...
Click to collapse
download the source code of the app, download androidstudio or eclipse, jdk and set up build environment... set up androidstudio/eclipse and the workspace... import the project, do your modifications, compile the project.. profit
small request
can you devs make a themer for ASOP using xposed .because no themer lik xthemer or hkthemer support cm11 or cm12 themes.thank you
jjbro007 said:
can you devs make a themer for ASOP using xposed .because no themer lik xthemer or hkthemer support cm11 or cm12 themes.thank you
Click to expand...
Click to collapse
I'll made for You :good:
EnricoD said:
I'll made for You :good:
Click to expand...
Click to collapse
thank you so much for trying.many guys will be happy to see such a themer.i will help in promoting the module.even you can put a price on it if you want.all will be very thankfull.
Say a user downloads and installs this Theme Installer. They pick a theme and install, then a week later an update to that theme comes out. I'm assuming we would have to push out the full Theme Installer for the update, but will the theme the user already has installed get updated on their phone during this process or will they have to manually do it requiring them to have to check regularly for updates? This part always confused me.
93Akkord said:
Say a user downloads and installs this Theme Installer. They pick a theme and install, then a week later an update to that theme comes out. I'm assuming we would have to push out the full Theme Installer for the update, but will the theme the user already has installed get updated on their phone during this process or will they have to manually do it requiring them to have to check regularly for updates? This part always confused me.
Click to expand...
Click to collapse
Just like how Veu worked in CM11, you update the app, then you update the theme within the app.
awesome handy stuff! .... i just decompiled to apk and tried to replace the included theme.
38 To insert the image of the subject that will appear in the installation window should change some lines of code (look for "Change it for image Theme"):
39 ```
40 switch (auxTheme.theme_name) {
41 houses "Lin": // Replace Lin with your Theme Name
Click to expand...
Click to collapse
could you please be a bit more specific or better say "noob-friendly", how to add and change the included themes?
@93Akkord
To be as clear as possible, this application, as the theme installer, does nothing but collect a family of themes in one package, so that those who download the application can use all the themes in it.
In the event that an issue was updated would be updated must also application (theme installer), then it is the user who has to manually update the theme that had already installed. I hope to be exhaustive, if not, do not be afraid to ask for further explanations.
@ _moelle
you, then the addition of a theme is very very simple.
If we do, your theme is called moellered.apk, you must simply copy the apk in your assets / Files.
the second thing you have to update the files that contain the information and the colors of your theme.
Let's see how you do, go in app / src / main / res / values-v21 / arrays.xml and modify the following information:
Code:
<String-array name = "theme_names">
<Item> Lin </ item>
<Item> Daa </ item>
</ String-array>
Here contains information on the names of themes you want to insert in the installer, remember you're inserting the theme moellered then we can change this array like this:
Code:
<String-array name = "theme_names">
<Item> MoelleRed </ item>
</ String-array>
Let the name of the package and take the example com.example.moellered package as your theme.
before we have:
Code:
<String-array name = "theme_packages">
<Item> com.example.theme1 </ item>
<Item> com.example.theme2 </ item>
</ String-array>
after we have:
Code:
<String-array name = "theme_packages">
<Item> com.example.moellered </ item>
</ String-array>
it's time the motto of the theme , we take as an example that the motto of moellered is "Moelle is Red, Moelle is Awesome" thus:
before:
Code:
<String-array name = "theme_motto">
<Item> Leak, Coming Soon, Follow me </ item>
<Item> Not now, Fake, Maybe </ item>
</ String-array>
after:
Code:
<String-array name = "theme_motto">
<Item> Moelle is Red, Moelle is Awesome </ item>
</ String-array>
Lacks to change colors, we know that lollipop is based on four main colors,
primary, primaryDark, accent and highlighted and in fact we find 4 array containing the colors of your theme, make an example for the primary, the operation is indentical to the other three, you just have to change the color codes.
take # F44336 primary color of your theme and we would modify the array:
before we have:
Code:
<String-array name = "theme_colors">
<Item> # 009 688 </ item>
<Item> # f44336 </ item>
</ String-array>
after we have:
Code:
<String-array name = "theme_colors">
<Item> # F44336 </ item>
</ String-array>
Remembers each line in an array is the information related to a theme, if in addition to moellered wanted to add a theme moelleyellow, then you will need to enter the information relating to that theme even in these arrays, one example is:
Code:
<String-array name = "theme_names">
<Item> MoelleRed </ item>
<Item> MoelleYellow </ item>
</ String-array>
Code:
<String-array name = "theme_packages">
<Item> com.example.moelleyellow </ item>
</ String-array>
Code:
<String-array name = "theme_motto">
<Item> Moelle is Red, Moelle is Awesome </ item>
<Item> Yellow, Yellow, Moelle </ item>
</ String-array>
Code:
<String-array name = "theme_colors">
<Item> # F44336 </ item>
<Item> # FFEB3B </ item>
</ String-array>
Now we can do is add images related to the theme, with version 1.7 of piller Added gallery for each theme, if you use an older version we strongly recommend you to upgrade if you could not, below are the old method, so we go to the Assets folder of our project and we create two folders and MoelleRed MoelleYellow inside them we can put all the images to be included in the gallery, there are no limitations on the number and their name, it 's important that the folder names coincide with those of the theme to which they refer.
Old Version of Piller [Deprecated]
Lastly there are pictures to be included, we go in app / src / main / res / and insert images into folders drawable, (we for convenience we have inserted two directly in the drawable folder, but you can insert them in the right size various folders drawable-xxhdpi, drawable-xhdpi and so on)
call the two images and moellered.png moelleyellow.png the code will be:
before:
Code:
switch (auxTheme.theme_name) {
case "Lin": // Replace Lin with your Theme Name
res = R.drawable.imm; // Replace imm with your image name
break;
case "Daa": // Replace Lin with your Theme Name
res = R.drawable.imm2; // Replace imm with your image name
}
after:
Code:
switch (auxTheme.theme_name) {
case "MoelleRed": // Replace Lin with your Theme Name
res = R.drawable.moellered; // Replace imm with your image name
break;
case "MoelleYelllow": // Replace Lin with your Theme Name
res = R.drawable.moelleyellow; // Replace imm with your image name
}
I hope I was as exhaustive as possible, for any questions or concerns please do not hesitate to ask, even directly hangouts or email.
@remeic
Awesome guide Sir..... Can't wait to try and thanks to my buddy @nicholaschum that introduced this...I've been wanting to do this for all my XKrome themes.
Cant compile it..
extract the zip from https://github.com/pillSoft/Piller
open the project with android studio
and i get that error :
Unable to start activity ComponentInfo{io.github.pillsoft.piller/io.github.pillsoft.piller.MainActivity}: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
could be more colors
@qreto I'm not sure you understand, you can explain?
@side you managed to solve? are you sure you have put your public key?
side said:
Cant compile it..
extract the zip from https://github.com/pillSoft/Piller
open the project with android studio
and i get that error :
Unable to start activity ComponentInfo{io.github.pillsoft.piller/io.github.pillsoft.piller.MainActivity}: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
Click to expand...
Click to collapse
remeic said:
@qreto I'm not sure you understand, you can explain?
@side you managed to solve? are you sure you have put your public key?
Click to expand...
Click to collapse
I found out what to do for this. You have to comment out more than just the stuff in the instructions.
Must comment out these TWO lines instead of one in the github instructions, inside MainActivity.java
https://github.com/pillSoft/Piller/.../github/pillsoft/piller/MainActivity.java#L74
Java:
mLicenseChecker = new EasyLicenseChecker(this, new Handler());
mLicenseChecker.start();
and make it into this:
Java:
/*mLicenseChecker = new EasyLicenseChecker(this, new Handler());
mLicenseChecker.start();*/
@remeic, it'd be great if you can update the guide (on the github source) to reflect this change.

Help enabling downloads through webview (Kotlin)

Good day. I'm new to android development and I'm trying to develop a simple webview application, picked a nice template and went through the steps and made good progress, I managed to load my site fully and enable javascript, that works as intended, however I'm not able to make the app download anything, I host a few pdf files that should open or download through it, but nothing happens.
I looked at a few answers here and it is to my understanding that I need to specifically add a function for that, could you give me a hand? I have tried multiple different code and tweaking them, but I wasn't able to get it to work, here is my base code:
Code:
package com.logista.test.ui.home
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import android.app.DownloadManager
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import com.logista.test.R
class HomeFragment : Fragment() {
private lateinit var homeViewModel: HomeViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
homeViewModel =
ViewModelProvider(this).get(HomeViewModel::class.java)
val root = inflater.inflate(R.layout.fragment_home, container, false)
val myWebView: WebView = root.findViewById(R.id.webview)
myWebView.webViewClient = WebViewClient()
myWebView.settings.javaScriptEnabled = true
myWebView.loadUrl("https://www.example.org/")
return root
}
}
I believe I should be adding
Code:
import android.app.DownloadManager
And tweak this
Code:
// Set web view download listener
web_view.setDownloadListener(DownloadListener {
url,
userAgent,
contentDescription,
mimetype,
contentLength ->
// Initialize download request
val request = DownloadManager.Request(Uri.parse(url))
// Get the cookie
val cookies = CookieManager.getInstance().getCookie(url)
// Add the download request header
request.addRequestHeader("Cookie",cookies)
request.addRequestHeader("User-Agent",userAgent)
// Set download request description
request.setDescription("Downloading requested file....")
// Set download request mime tytpe
request.setMimeType(mimetype)
// Allow scanning
request.allowScanningByMediaScanner()
// Download request notification setting
request.setNotificationVisibility(
DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
// Guess the file name
val fileName = URLUtil.guessFileName(url, contentDescription, mimetype)
// Set a destination storage for downloaded file
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName)
// Set request title
request.setTitle(URLUtil.guessFileName(url, contentDescription, mimetype));
// DownloadManager request more settings
request.setAllowedOverMetered(true)
request.setAllowedOverRoaming(false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
request.setRequiresCharging(false)
request.setRequiresDeviceIdle(false)
}
request.setVisibleInDownloadsUi(true)
// Get the system download service
val dManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
// Finally, request the download to system download service
dManager.enqueue(request)
})
// Load button click listener
button_load.setOnClickListener{
// Load url in a web view
web_view.loadUrl(url)
}
}
Taken from here: https://android--code.blogspot.com/2018/03/android-kotlin-webview-file-download.html
I did the basics, renaming the function accordingly and such, but it gives me quite a few errors when building the app, for instance uri isn't defined, cookiemanager isn't defined, environment isn't defined, build isn't defined, and such, could you give me some guidance?

Categories

Resources