[Q] How to get the last update data from xml file? - Android Q&A, Help & Troubleshooting

I'm developing an application about alert earthquakes. The information I get from an XML file and I want every time the XML file is updated with a new earthquake, this notifies the phone, even if the application is closed. How I can know the last earthquake, if I have the following XML structure? Maybe with an array?
<markers>
<marker lat="-4.33" lng="-80.38" mg="3.8" z="10" fecha="2014/09/11 19:22:26" detalle="true"/>
<marker lat="-3.68" lng="-78.03" mg="3.9" z="10" fecha="2014/09/11 05:22:52" detalle="true"/>
<marker lat="0.91" lng="-78.47" mg="3.5" z="10" fecha="2014/09/11 03:53:45" detalle="true"/>
</markers>

Related

Need help with starter app in eclipse

Hello,
I am very new to eclipse and java programming and I am attempting to create a simple soundboard as a starter project. I have already created my raw folders and have all my files in the correct folder. I have my main.xml setup and my layout prepared with the graphics icons etc. Just the last part I cannot figure out. In the properties for the button I have enabled the button to be clickable and enabled soundfx. My guess was I have to create a Onclick string and assign the sound file to the string and button. I am feeling kind of lost if anyone can help me out would be greatly appreciated.
Leigh G.

Wifi Calling, Modifying, & Signing ims-service.apk

​ims-service.apk is part of Wifi Calling. Upon decompilation it appears to contain a file res/values/strings.xml that contains information for connecting to the tmobile sip server. Now, I would like to modify this server info so I can connect to the sip server of my choice. However, merely decomp/editing/building ims-service.apk creates an unusable apk. This is due to its lack of signing? Would I be able to sign the apk myself or would I need the cert the authors used due to trust issues from other apk's using this apk (rendering any rebuilds futile and signing impossible)? Another approach I found would be to just decompile, edit the xml, and add the xml into the unmodified ims-service.apk. However, upon openning ims-service.apk with 7zip there is no res/values/ folder or the strings.xml.
Any guidance?
other resources -
http://code.google.com/p/the-ims-open-source-project-for-android/
looks like all i have to do is drag in a modified resources.arsc?

[Q] [Advanced question] Editing framework

I'm recently trying to edit my framework with this mod
http://forum.xda-developers.com/show....php?t=1916094
Well actually the steps in that thread are very simple, but since I'm trying to apply that to my Xperia Ray so it must have slightly different steps
What I want to ask :
- In framework/res, I found drawable-.........( mdpi,hdmpi,ldpi,etc.). If I'm going to replace the .9png's picture in there, should I make the picture as same as the original picture dimension? I'm using Dev-Drawable app in the Play Store ( it makes picture to drawable- hdpi,mdpi,etc. ), the result of using it is it gives me the mdpi version of the picture but with different dimesion from the original picture.
- I found errors and it says that I have errors in the /res/values/public.xml
I found this :
Code:
Don't do that! I think I should explain the purpose of public.xml file in the project wiki, because many people are confused. Note that you don't need this file when you build an apk from sources and apktool building mechanisms are very similar, so guess what: you could remove this file from decoded application and apktool will rebuild it without any problems. I had a reason why to generate public.xml - it's a feature, not a bug!
Well, the reason is: there may be references to resources in the application code. If resources ids will change after build, then code will reference different resources than in original apk. public.xml file gives us sureness that resources will get same ids after build - it's the only one reason to use this file. And you want to manually modify these ids
Adding or removing new resources is somewhat tricky. Yeah, I should write about that in the wiki.
You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code.
There is never much sense in modifying ids in public.xml, because then modified lines lose their purpose.
If you want to add new resources, e.g. drawables and use them in the XML files you don't have to change anything in the public.xml file.
If you want to add new resources and use them in your code, then you have to add them into public.xml, because you need to reference them somehow. Or you could use Resources.getIdentifier() method, but this is ugly.
And now the most tricky part: if you want to remove some resources, you have to remove info about them from public.xml as well. So first you have to be sure that they aren't referenced in the code. But there is also this "hole" problem, so:
If these resources are at the end of ids stack, then there is no problem.
If resources are near the end of ids stack and you are sure, that all resources after them aren't referenced in the code as well, then you could just remove them all. Actually you have did virtually the same, cause after modifying ids you made these lines totally useless, you broke them, so you could just remove them.
If you want to remove some resources, but add same or greater quantity of new ones (of the same type), then there is no problem - new resources will automatically fill in "holes" in ids. You don't have to add them to public.xml .
If none of above conditions are met, then you have holes and you have to fill them by something. But you don't have to add "useless .pngs" - just add:
Code:
<item type="drawable" name="DUMMY1" />
<item type="drawable" name="DUMMY2" />
<item type="drawable" name="DUMMY3" />
...
Like above, you don't have to add these resources to the public.xml .
And because I'm a newbie I don't really get what that mean. So I just delete the files that I'm going to replace and I can re-compile the framework, but I got bootloop, LOL.
I confused about :
1."You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code."
What are the "holes" and " referenced in the code" mean?
2. Because I want to add .png's picture to the drawable-mdpi folder, Do I need to add dummies to the public.xml ?
3. I'm using the tricky signing method ( open archive in the original framework, copy meta-inf & android manifest and replace those files to the modded framework). Is this cause me an error?
Help me mateee
Why do you post this thread 2 times?
mihahn said:
Why do you post this thread 2 times?
Click to expand...
Click to collapse
Cause no one reply & help meee:crying:
RivaultUser said:
What I want to ask :
- In framework/res, I found drawable-.........( mdpi,hdmpi,ldpi,etc.). If I'm going to replace the .9png's picture in there, should I make the picture as same as the original picture dimension? I'm using Dev-Drawable app in the Play Store ( it makes picture to drawable- hdpi,mdpi,etc. ), the result of using it is it gives me the mdpi version of the picture but with different dimesion from the original picture.
Click to expand...
Click to collapse
It's best to keep the original dimensions yes although not essential, but some images will look strange if not.
RivaultUser said:
- I found errors and it says that I have errors in the /res/values/public.xml
I found this :
Code:
Don't do that! I think I should explain the purpose of public.xml file in the project wiki, because many people are confused. Note that you don't need this file when you build an apk from sources and apktool building mechanisms are very similar, so guess what: you could remove this file from decoded application and apktool will rebuild it without any problems. I had a reason why to generate public.xml - it's a feature, not a bug!...
I confused about :
1."You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code."
What are the "holes" and " referenced in the code" mean?
Click to expand...
Click to collapse
It means you can remove lines so long as they don't point to anything in the drawables folder for example.
RivaultUser said:
2. Because I want to add .png's picture to the drawable-mdpi folder, Do I need to add dummies to the public.xml ?
Click to expand...
Click to collapse
No.
RivaultUser said:
3. I'm using the tricky signing method ( open archive in the original framework, copy meta-inf & android manifest and replace those files to the modded framework). Is this cause me an error?
Click to expand...
Click to collapse
No. If you're doing it like in my guide you should be fine. Re read the bold quoted text above.

How to Re-Sign System APK for Android

I wanted to disable the Flash to black/screen update function on my yotaphone 2 e-ink's screen as it really disturbes me. I worked out there was a setting to do this in the phones SDK app.
I decompiled the YD_YotaphoneSDK.apk app and changed some of the settings in the classes.dex files so as to disable the full screen refresh (i.e change the backscreenmanager waveform mode to A2). I then recompiled the YD_YotaphoneSDK.apk app however when I attempt to install it on my YotaPhone it states 'Parse Error- There was a problem while parsing the package'.
Im pretty sure it needs to be resigned but cannot workout how, when i attempt to do so in android studio i get the following error: Error:Android Source Generator: [YD_YotaphoneSDK] Package is not specified in AndroidManifest.xml
Can anybody with some relevant experience give my some suggestions of how I can resign or enable this recompiled version of the APK to be installed on my yotaphone.
I have attached the edited apk file
Regards

How to Localize an app by downloading the translated strings from a server

How to Localize an app by downloading the translated strings from a server . ( without bundling translations as separate strings.xml within APK ) ?
Normally multiple language support is added to android applications by defining extra strings.xml file corresponding the locale.
Recently I came across an android application which downloads the translations in key:value pair format as json from parent server and updates the UI by replacing the strings with the downloaded translations.
I'm curious about how this works within the android application.
Any insights on this topic would be really helpful.
Thanks
Update :
Please consider the scenario where I have hundreds of TextViews in my app to change, and if I want this change to persist when app is opened next time. Is there a way to persist this change on app, so that I don't have to programatically change the strings every time I load the app, which would essentially slow it down. ?

Categories

Resources