Xamarin MVVM : Work with just one JSON Folder to change language - android

I want to know if we can create just one Localization folder for my application in MVVMCross (Android, IOS, Core) to change the language.
In fact, i watching this video/tuto to change my Application Language with MVVMCross: https://youtu.be/VkxHtbJ_Tlk
I downloaded the sample too and i can see, his folder BabelResources is in his Android project, in his IOS Projet, in WPF etc...
I can't create just one ressource folder and create just one JSON file with my translation (In my PCL for example)
Thank for your help

http://opendix.blogspot.dk/2013/05/using-resx-files-for-localization-in.html
or`
http://enginecore.blogspot.dk/2013/09/localization-in-xamarin-mvvmcross_18.html
or
http://blog.giovannimodica.com/post/internationalization-of-a-cross-platform-application
Hope one of them can help you on your way :) Alternatively, you could add the translation file in for example the android project and add it as link in the ios project.

Here's an alternative using simple text files in your PCL: https://github.com/xleon/I18N-Portable

The video tutorial you're referring to is using linked files in other projects. So you setup up only one resource file and use it in all the platform projects by linking to the file (instead of copying it)
You can find the source here: https://github.com/MvvmCross/MvvmCross-Tutorials/tree/master/Babel

Related

How to arrange existing java classes into different packages in android studio?

I am using android studio to design an application. I have created a few java classes and want to put them in different packages. I have already created the java classes and have implemented the code inside them. However, now, I want to put them under different packages according to their utility. How can I do that?
In short, I want to go from here:
to here:
Sorry for the blurry image, I took it from a video tutorial.
There are different things you can do:
Drag the java classes and drop them into the package you want
Open the app folder from your computer files searcher and just ctl + x the .java files and paste them in the folders you want(creating a new package)
Create new java files inside the packages you want and just copy the code from the java files located wrongly. After that delete the java files you don't need.
Hope it helps.

How can I convert .vp file into .xml or .apk file?

I'm using justinMind and I get .vp file.I am able to convert it in .html file but how can I convert it in .xml or .apk?I have tried to convert .html to .xml by using .tidy but It doesn't give me proper layout in my androidstudio.
I don't know this SDK, but from I quick search, I found this post on there forum :
https://www.justinmind.com/community/topic/can-justmind-export-the-prototype-directly-to-the-android-studio-project
For long term save, here is the two post :
Question : I can use the software for simple designing and prototyping. It will reduce the app build time if there is a way to export the files as an android studio project. Is this possible?
Answer
Hi there,
Unfortunately that is not possible. However, you can utilize the
generated CSS and Javascript, which may help reduce app build time.
Best,
Danielle
So you need to use the generetad HTML/Javascript/Css files with a WebView. So no, you can't create a project, only the HTML files.

why can't access some of android.R.drawables?

I'm creating my applications. but i want to use android default drawables icon (calendar, camera or etc...)
some of icons can be use.
but some of cannot.
here is my code
android.R.drawable.ic_menu_camera it's okay to use.
but android.R.drawable.ic_menu_cc_am is error in Android studio
this file(ic_menu_cc_am) exists in android sdk and can jump to declaration like this.
why I can't use of this file (some of files also can't using on android studio, but file is exists!)
sorry for my bad english.
thank you.

Android & iOS: Best way to create multiple similar apps

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.

Parse Android xml file instead of iOS .strings

So as mobile developers, every time we translate one of our apps we have to translate both Android and iOS strings files. These files contain 90% of the same strings just the file is in a different format.
Does anyone know if there is an NSLocalizedString override to read from Android compatible .xml files? or if this is even possible?
Alternatively, is there a command line tool to convert between the two formats?
This does what you need, but not from the command line.
http://localise.biz/free/converter/ios-to-android
The full system has an API though. If you register you'll be able to pull your translations into .strings or Android XML files from the command line, or programmatically via a simple script.
So it turns out this kind of tool doesn't exist. I created a toolchain and posted it here.
If there is activity I will develop it further.
For a recent project which already had 19 translations, I was also looking for a script to convert the XCode Localizable.strings files to Android Eclipse format.
I found convertLocalizable.rb but I can't work with ruby, so I've created a Javascript based on it, see link below. You have to cut and paste each file but it works great.
Javascript XCode Localizable.strings and Android strings.xml convertor
Here's a simple script that will generate iOS Localizable.strings from Android strings.xml files.
Try Twine - a robust project for converting resources.

Categories

Resources