How to make reference of a resource file? - Android Software Development

When I tried to modify the status bar theme, I know it would be one of the files inside of res\drawable-hdpi, beginning with status*.png. I am curious where the reference is made in the source code, or it is defined in one of the xml file?
Can someone point me the direction? Thanks!

Related

RIL lib

Hi,
I want to try to make a phone call using the RIL on a smartphone.
Is it possible ?
How can I get the ril.lib ?
If someone has already developed such a service please send me thoe source .
in tstril.zip from http://xda-developers.com/RIL/ there is a ril.lib file.
you can create it your self by running
Code:
lib /def:ril.def /machine:arm
the ril.h is far from complete. maybe someone has the time to copy
them from the patents.
the constants are more work, you need to do some reverse engineering to find those.
and the patent may not be exactly what has been implemented.
Where is the ril.def ? Have I to define it by myself ?
Where is the complete ril.h ? Is it the same as in tsril ?
In fact I want to use the RILDial function and I need to know
the syntax of this function.
Thanks for your answer
XDA developer Itsme said:
in tstril.zip from http://xda-developers.com/RIL/ there is a ril.lib file.
you can create it your self by running
Code:
lib /def:ril.def /machine:arm
the ril.h is far from complete. maybe someone has the time to copy
them from the patents.
the constants are more work, you need to do some reverse engineering to find those.
and the patent may not be exactly what has been implemented.
Click to expand...
Click to collapse
have you looked in the tstril.zip archive on that page?
itsme said:
in tstril.zip from http://xda-developers.com/RIL/ there is a ril.lib file.
you can create it your self by running
Code:
lib /def:ril.def /machine:arm
the ril.h is far from complete. maybe someone has the time to copy
them from the patents.
the constants are more work, you need to do some reverse engineering to find those.
and the patent may not be exactly what has been implemented.
Click to expand...
Click to collapse
i looked for it ,but have no that page ...........
As a developer, I started to explorer more my device.
I created a small application to expose all RIL messages.
This app is still in development but feel free to use it.
Ideas are welcome.
Thanks.
RIL Lib
I found an update RIL.H.
I have updated the DEF file and created a new LIB file.
Note: I have updated DEF based on MSDN and not based on the H file. Maybe some reference to certain API are still missing on the H file.

[JAR][frameworks] A little program to automate changing all those ids

Don't you wish smalis referenced xml by their tag name instead of those hex numbers? It would be so much easier to port smalis from one framework to another.
Changing every id that is different from the original fw to the destination fw by hand is feasible, but very time consuming. Thus, I made this little java program to automate the task. It runs in the command line, and takes four arguments: the smali you want to change, the smali to be created, the original public.xml, and the target public.xml
It is meant to be used with the script that is also attached, to change all the smali files in any directory. It should work also in windows, but I don't include a .bat file since I only tested this in ubuntu.
the idea is to use it like this:
Code:
./changeAllIds.sh in/ out/ original.xml target.xml > log 2 > err.log
Known issues/bugs/TODO-list:
- The bad news is that the program will throw an exception if there is an id in the smali file that is present in the original.xml but not in the target.xml. The good news is that it will output to stderr the name of the smali file and the line that has that reference, so you can immediately know which one is and add it to the target fw.
- For some reason, the ids 'ok' and 'cancel' will make this program crash. It was for me faster to temporally remove those references in the smali file and continue (adding them back later) rather than fixing the code. You're welcome to fix it if you feel like.
Source code can be found here:
https://github.com/aleadam/xml_id_changer
Well, thank you Sine for linking me to another post in the Vibrant forum.
There is a java program made by untermensch posted 3 days ago that does the same. Except, as judging by the description and the comments, that it's well done, as opposed to the crude and amateur code I posted above
http://forum.xda-developers.com/showthread.php?t=945637

Spell checker on Note 3

Dear All,
Do you all missed the spellchecker feature (the little red underline) in the last phone you used? (At least I do~)
I may have found a solution. http://forum.xda-developers.com/showthread.php?p=34856343
However, when I decompiled the xml file, the code is messy and unreadable. So does anyone else want to try it out or tell me how to correct the xml file format?
Many thanks~
echaya said:
Dear All,
Do you all missed the spellchecker feature (the little red underline) in the last phone you used? (At least I do~)
I may have found a solution. http://forum.xda-developers.com/showthread.php?p=34856343
However, when I decompiled the xml file, the code is messy and unreadable. So does anyone else want to try it out or tell me how to correct the xml file format?
Many thanks~
Click to expand...
Click to collapse
Where you able to find a resolution for this. I am getting errors when I try to recompile the files.
any luck?

A sentence about usefulness of Resources

Hi
In "Hello Android" book that i am reading , there is a sentence about usefulness of Resources that i can't understand .
Please give me some help about it .
The paragraph is :
"The resource compiler compresses and packs your resources and then
generates a class named R that contains identifiers you use to reference
those resources in your program. This is a little different from standard
Java resources, which are referenced by key strings. Doing it this way
allows Android to make sure all your references are valid and saves
space by not having to store all those resource keys. Eclipse uses a
similar method to store and reference the resources in Eclipse plug-ins."
The underlined sentence has two part .
I understand part one in this way :
When there is some error in for example XML lay out files in Android project in Eclipse IDE ,
The IDE does not work correctly and some red signs are appeared next to files that have
error in left side project browser of Eclipse.
Is the thing that i understood is correct and complete ???
And about part two .
I cant understand it . What it says ??
Thanks for your help
peter.sorotokin said:
Hi
In "Hello Android" book that i am reading , there is a sentence about usefulness of Resources that i can't understand .
Please give me some help about it .
The paragraph is :
"The resource compiler compresses and packs your resources and then
generates a class named R that contains identifiers you use to reference
those resources in your program. This is a little different from standard
Java resources, which are referenced by key strings. Doing it this way
allows Android to make sure all your references are valid and saves
space by not having to store all those resource keys. Eclipse uses a
similar method to store and reference the resources in Eclipse plug-ins."
The underlined sentence has two part .
I understand part one in this way :
When there is some error in for example XML lay out files in Android project in Eclipse IDE ,
The IDE does not work correctly and some red signs are appeared next to files that have
error in left side project browser of Eclipse.
Is the thing that i understood is correct and complete ???
And about part two .
I cant understand it . What it says ??
Thanks for your help
Click to expand...
Click to collapse
Whenever you add a resource(image, raw file, drawable, etc) in your app package, a separate class named as R.java forms in your gen folder. This cannot be edited by you and can only be modified by the IDE. All your resources will be given a unique id by which you can refer to them from your Java classes. It will revert to the generated version if you try to modify it manually.
I guess that the way you understood the first part is correct. But it also applies to Java code. In the Android Java code you use these identifiers to load resources. You don't use hard-coded Strings. That way the compiler can check whether a resource with that name exists by checking whether the reference to the field in R is valid. If you had to put in hard-coded Strings, there would be no (easy) way to check that.
About the second part: I guess that it means that Strings need more storage space.
If we talk about usefulness of resources, this is a much bigger point to me: You can define different resources for portrait and landscape mode, for different countries, for different screen sizes, for different OS versions, etc. and Android cares about using the right one. You don't need to decide which one to use yourself.
You can also refer to them from Java and xml very easily. You just need to change one line of code to change a String that is used multiple times in your app. You can't forget one.
Link for a much more detailed description: http://developer.android.com/guide/topics/resources/overview.html (including the sub-topics)
However, I guess that you won't need that many details in the beginning. Your book should explain the most important things.

App Localization / Globalization?

Hi all!
I'm a fairly inexperienced one-man developer, and I'm looking to make my apps viewable in different languages, in order to increase its popularity/usefulness in other countries.
My apps are quite text-heavy, so ideally it could be as simple as re-directing to text files with the proper language included, but I honestly have NO idea and I haven't been able to find any step-by-step tutorials simple enough to make sense to me.
Can anyone here help? Or at least point me in the right direction?
Thanks.
Also, if this topic is in the wrong section, please feel free to move it....
You can use resources files in Visual Studio. Create a folder named AppLocalResources for just a folder in you project and a folder named App_GlobalResources for your entire solution. In this folders you can add a Resource file name like your objects. See more on MSDN
TrivialPanPan said:
You can use resources files in Visual Studio. Create a folder named AppLocalResources for just a folder in you project and a folder named App_GlobalResources for your entire solution. In this folders you can add a Resource file name like your objects. See more on MSDN
Click to expand...
Click to collapse
thanks for your help .
Here is a link in MSDN :
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff637520(v=vs.105).aspx
hope to help you

Categories

Resources