A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!
I had created a bulky activity and now I need to modify a lot in it. I decided to first copy paste the entire code on text box but I do not think it is the right way. I want to save the activity consisting of xml file and .java file in a single file that can be recalled if required. Is this possible or should I copy and paste both file to some location manually.
Thanks
In modern Software development it is often a good practice to use some kind of version control system.
A lot of people are using systems based on git like GitLab, GitHub, BitBucket etc.
These tools help to manage your source code in different versions and enable you to switch between versions easily.
In your case you could decide to work with github and after pushing your project you could compare your recent code with the new one until you decide your refactoring is done.
If you decide to dive into this you find many tutorials with google.
e.G https://www.codecademy.com/learn/learn-git
I've created an app which pulls data from a JSON file and displays it.
Now that app is specific for one sports team. I want to create the same app for 10 other teams.
Plus there will be an accompanying pro version of the app.
I'll be doing the same thing for the iOS version.
The only difference between the apps will be colors, logos and url of the data source.
I wanted to know if there was a better way to create apps. Instead of individually creating 40 different projects.
It will help me in updating the app as opposed to copy pasting the same code 40X.
Are there any special features available in eclipse and xcode to do that?
Thanks
I would simply swap out the resources for each team and rebuild the app.
For example, with Android, maintain an AndroidManifest.xml and a res/ subdirectory tree for each team. When it is time to build, simply copy over the resources into the project, overwriting the previous team.
I don't know of any existing tool to do this automatically, however.
Have you looked into using PhoneGap and just create a "mobile site" that detects the app that is connecting and adjusts the data/styles accordingly.
There's always the possibility of creating ONE app allowing the user to set the team preference upon first load, and swapping out resources programmatically.
With Titanium Studio you can write code using Javascript and it convert your code in native objective-c code, native android code, native html 5 code and soon also in windows phone code. It`s the best free cross platform IDE
Upon reviewing your responses, you seem to want a strategy to manage your resources. Since different OS has different resource requirements (screen-size, iOS 2x png for example). The most common strategy is to keep a separate resource structure and setup build target to copy/xcopy replace these image resources before build. Source control + an OSX build server would be most beneficial.
After creating these apps I've found the following way to be the most easiest way to create a similar app.
Android:
1. Select the project from the project explorer sidebar copy it and then paste it. Give it a new name.
Select the new project and then right click > Android Tools > Change Package Name.
Give it a new package name. Eclipse will give you an option to refactor the code, say yes.
Go to res/values and change all strings.
Change the icons and other images.
Go to src click the package and then refactor it. Give it the new package name.
Go to manifest file and rename any old names which might still be lingering.
In Android, you can specify the texts in the default locale in res/values/strings.xml. Additional translations can be added for new languages in res/values-it/strings.xml (for Italian for example). If a string is not translated, the fallback-default locale is used.
Currently I can not tell which strings I still need to translate (so are in values/strings.xml, but not in values-$/strings.xml for all $ in languages) and which are translated, although the are obsolte (so are in values-$/strings.xml, but not in values/strings.xml exists $ in languages)
I'm searching for a tool which gives me the translations which are missing and the one which are obsolete.
To be honest, it is not that difficult to write such a tool for the command-line, I can only hardly believe nobody has already done this.
This isn't automated, but it's very fast. In Eclipse, to go Window->Show View->Other->Android->Resource Explorer.
Now, under the Resource Explorer tab at the bottom (or wherever you've moved it to) look under String. Each string should have the same number of versions if you have a complete translation, so you can scan down the list in just a few seconds.
Do this for each project that has strings.
I didn't know about this until after I localized, but it's still useful (such as when I add a new string).
If you are using Android Studio, it is easy to find which string is missing.
Right click on values/strings.xml
and choose Open Translations Editor:
Where you can easily find missing strings in all languages as below :
Thank You...
The new official Android Lint tool helps you detect this problem, and many others: http://tools.android.com/tips/lint
Interesting question. I've wrote simple script to find duplicate resources in android project at https://gist.github.com/1133059. It is ugly, I know, but I'll rewrite it in a few days and maybe create a project on github.
To run it from console:
$scala DuplicatesFinder.scala /path/to/android/project
UPDATE:
I've made a project on github https://github.com/4e6/android-localization-helper, maybe someone find it helpful
There's a much improved version of the Android Dev Kit lint tool in Eclipse since SDK version 17 - see the docs here: New Eclipse Lint UI
Just click the "lint" tool bar item, run it on your project then open the "is not translated" item that will appear to show you every tag that needs translation.
Credit to satur9nine - this is an updated version of their answer which lead me to this one.
You could also use Android lint (easy access from Eclipse). Right click your project -> Android Tools -> Run Lint. This will give you a list of all missing translations, and also some other common errors.
It will also show you duplicate resources and strings not available in the default translation.
On Android Studio, Analyze > Run Inspection By Name, Type following and execute inspections for Custom scope Project Production Files.
Extra translation
Incomplete translation
I created a tool to solve precisely this problem. You can download the tool from https://github.com/vijtheveg/tea.
The tool can generate an Excel spreadsheet from the Android project, like the one shown below, with the source strings and their translations shown side-by-side.
Most importantly, the tool will output only those strings that were newly added or modified since the last translation!
You can send this Excel spreadsheet to your translator and once the translations are filled in, you can regenerate the string XML files for the target language from this Excel file.
Best of all, you can perform this process (add/delete/modify strings in the source language XML files) -> (generate Excel and send it for translation) -> (regenerate target language XML files) any number of times, and each time the tool will only output those strings that need translation into the Excel file. The tool will also delete strings that have been removed from the source language from the target language XML files.
More details on the tool's GitHub page above. I hope you find it useful.
I'm the Product Manager for MOTODEV Studio. As #hjw mentioned, this is a feature of MOTODEV Studio called the "Localization Files Editor". This editor is similar to a spreadsheet and lets you see all your strings in one view. You can edit as a spreadsheet or the underlying XML in the same view.
MOTODEV Studio is a branded version of Eclipse, so it should work with your existing projects if you use Eclipse. If you prefer to continue using your existing Eclipse setup, you can still use MOTODEV Studio to handle the editing of the string.xml files, just so long as only one version can have the workspace open at a time.
If you have any questions about how to use it, feel free to send me a message or post on our discussion boards at developer.motorola.com
There is none which I am aware, I am favouriting the question. :) However as a best practice, I first complete the default strings.xml and translate it in the very end. I also add a small marker comment to specify end of translation and any new strings are added below that. This helps me keep track of ones which are not translated.
-- UPDATE --
With latest ADT tool for eclipse you can install Lint which takes care of all the issues regarding duplicates and a lot more with its exhaustive set of warnings.
If you're willing to use the getlocalization.com web site, which is free of charge if you're willing to have your translators work on your localization publicly (otherwise, you have to pay to make your project private).
You can just use their Eclipse plugin, to automatically import the strings from your Android project:
http://getlocalization.github.io/eclipse/
Then this is the interface your translators will see when they do the actual translation:
I recommend you right-click on the screenshot above to view it in a larger format on a separate tab. It's actually well thought out and should make the translator's job easier too.
Steps to get all missing translations are :
enable lint error for missing translation in app level build.gradle
lintOptions {
abortOnError false
enable 'MissingTranslation'
}
add languages to compare inside default config of level.gradle (here english and hindi)
resConfigs "en", "hi"
right click on default strings.xml. Then Analyze -> Inspect Code
now check inspection result. Android -> Lint -> Correctness -> Messages > Incomplete Translation
All selected strings are missing translations
Do you know MotoDev Studio for Android? It features a localization tool. Within that tool all langauges are columns and all texts are rows. It's very easy to find missing translations within that "spreadsheet". The other way, find obsolet translations, is not that easy.
I suggest Amanuens that let you easily identify untranslated strings and strings that not match in master and translated files. It can, optionally, be configured to automatically keep translation files synchronized with the repository. You can also give your translators access to the service and they can find an easy to use web editor to translate your application.
I built a command line tool called ams (for android-missing-strings) that prints a report of every missing entry as well as leftover entries that no longer appear on your base strings.xml file.
It's available here
https://github.com/gubatron/android-missing-strings
ams - Android Missing Strings reporting tool.
Usage:
ams [-l xx[,yy,zz...]] -o <output_file>
Options:
-h --help Print this help
-l --lang <xx> Specify a language or many with comma separated 2-char language codes.
e.g: -l cn (creates report for Chinese strings.xml)
-l cn,it,fr (creates report for Chinese, Italian and French strings.xml files)
If this parameter is ommited, a report with every language file found will be created.
-o --oFile Specify the output file name for the report
Copyright (c) 2014 - The Mit License (MIT)
Authors:
Angel Leon <gubatron#gmail.com>
Katay Santos <kataysantos#gmail.com>
If you also want to let other people contribute and have a web site you can use the open source TranslateApp-tool.
It keeps track of what is translated and not, you can also update the default language and say if translations should be invalidated of not.
https://bitbucket.org/erik_melkersson/translateapp
Note: I am the author of the tool. Pull requests with updates are welcome. I actively use the tool myself.
How can I sync my strings.xml in Android if I'm using localisation and a new string needs also to be translated in values-de/strings.xml, values-ru/strings.xml ...
Do I really have to copy paste it in everey file - or is there a tool for managing translations?
If you don't provide a translation, the default value will be found in values/strings.xml if that file exists. MOTODEV Studio has a localization editor that allows you to see all your strings in a spreadsheet configuration, which might be easier for you to visualize. If you don't want to install MOTODEV Studio, you can install the Sequoyah plugins into your Eclipse IDE and get most of the functionality.
http://developer.motorola.com/docstools/motodevstudio/
http://www.eclipse.org/sequoyah/
UPDATE 2014/08/08 - The former MOTODEV plugins that were submitted to AOSP are finding new life in a Github project called Proteus. The string editor is included in Proteus and can be used as-is. The automatic translation feature through Google Translate doesn't work, but the column editor does work.
I understand your pain. Here is what I do. A java program parses string.xml. It creates a string-de.csv. I put that file in docs.google.com to share. I use the google translate function to populate the auto-translated column. I found some good hearted users to help me fix those translation. I save the translated google doc and create values-de/string.xml out of it using the same Java program.