Introduction If you are java developer you can use String.format for adding some parameters into your string. Core Java provides us mechanism to manage it using symbols like %s or {1}, but how to use this mechanism in Android resource strings? Resource Strings Android provides us good mechanism to format strings in application too. Just try to add %1$s or %1$d into your resource strings. The last symbols mean s – for string formatting d – for decimal…
"Android: Formatting Strings"Author: Hashim
I’ve created this project for testing my Android Application and tried to start it. After starting I have received next error: Test run failed: Unable to find instrumentation info for: ComponentInfo {<my package>/android.test.InstrumentationTestRunner} After few hours of investigation I have found solution for this situation. Problem So, Problem is name of package in the manifest files. The package in “real” manifest file and test manifest file are equal. For instance, look at the package com.blogspot.jugn in…
"Android: Unit Test Issues"I’ve found amazing case of sending sms messages from the code. Task I need to send SMS message from my test method and test behavior of parsing it. Just for this post we are interesting in first part: Sending SMS message from code. I’ve written next simple code: final SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(“5554”, null, “Test”, null, null); and tried to test it. Just put this code in simple test method and run Android Unit Test. The result is … nothing!!! Why?!! I…
"Android: Amazing Story about Sending SMS Messages from the Code"Introduction The next step in development Android application will be localization. I’ve read documentation from official site and from http://www.icanlocalize.com/ and decided to describe it. Sequence of resources lookup How does android lookup the resources from applications? The example of lookup steps below: ‘res/values-en-rUS/strings.xml’ ‘res/values-en/strings.xml’ ‘res/values/strings.xml’ Firsltly Android looks for resources in en-rUS folder if not found, looks in -en folder and just after it in default. If resource has been found then the search stops. Dismantle folders structure The next question that worried me…
"Android: Localization"Introduction I think each of us looking for the best IDE and best way of development. I think the best code editor is IntellJ IDEA and I am using it for 6 years. A few month ago I’ve started to use PlayFramework and were surprized that there is no way to debug application using IDE just browser and console logs and messages. After short investigation I’ve found solution … Solution This step-by-step solution for IntellJ…
"PlayFramework: Run and Debug Using IDE"