tag:blogger.com,1999:blog-16967813721845553622024-03-13T17:20:06.071+05:30JIT GuideJust In Time Guide brings you the guide in the right timeAnonymoushttp://www.blogger.com/profile/01006723763327398778noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1696781372184555362.post-37218693693936334652014-11-20T01:29:00.001+05:302014-11-25T01:04:47.272+05:30Enable Sinhala fonts rendering in Nexus 7 Android 5.0 LollipopI think you already know that Nexus 7 (2012) Android 5.0 factory image is out. Anyone can download it from <a href="https://developers.google.com/android/nexus/images" target="_blank">here</a> and isntall it.<br />
<br />
If you have successfully flashed it to your Nexus and if you are not seeing "Sinhala" characters properly you can enable it from the following method. <br />
<br />
If you haven't already root the new ROM<br />
Goto CF-Auto-Root beta download <a href="http://autoroot.chainfire.eu/" target="_blank">site</a><br />
<br />
Download correct boot image. You will find a zip file there.<br />
<br />
Turn off your device. Goto boot loader by holding volume down + power<br />
Connect the USB cable.<br />
<br />
Unzip it. Run<br />
For Linux : root-linux.sh<br />
For Mac : root-mac.sh<br />
For Windows root-windows.bat<br />
<br />
Your device will restart several times and install SuerpSU (Root utility) after final successful boot.<br />
<br />
Now your device is rooted.<br />
<br />
Download Sinhala fonts from <a href="https://www.google.com/get/noto/#/family/noto-sans-sinh" target="_blank">Google noto fonts</a><br />
You'll get a zip file which has two .ttf Sinhala fonts.<br />
(NotoSansSInhala-Regular.ttf and NotoSansSInhala-Bold.ttf)<br />
<br />
In order to add Sinhala font files you'll need a file browser which has root access capability.<br />
<br />
I used ES file explorer. Find it on <a href="https://play.google.com/store/apps/details?id=com.estrongs.android.pop&hl=en" target="_blank">Google Play</a><br />
In ES file explorer you have to open left drawer and enable Root Explorer feature to access system files.<br />
<br />
Copy two .ttf files which you downloaded earlier and copy them to the device<br />
<b>/system/fonts/</b><br />
folder<br />
<br />
Now reboot the devices and you'll see proper Sinhala character rendering. Anonymoushttp://www.blogger.com/profile/01006723763327398778noreply@blogger.com23tag:blogger.com,1999:blog-1696781372184555362.post-1492883427629995302014-03-15T18:06:00.003+05:302014-03-15T18:51:04.220+05:30[Android] Find unused resources in a project<div class="normal">
Most of the time we may need to delete unnecessary images or
other resource files before we deploy our project. Searching them one by one
and deleting them will be a pain.So here is a simple procedure to find them
automatically using Android Lint and remove them by a shell script.</div>
<div class="normal">
<h2>
1. Find resources</h2>
</div>
<div class="normal">
You can run a Lint check from the IDE you are using. But if
your project has a pile of lint warnings it may seem impossible to find the
unused resources. Therefore we need to run it using console. <br />
<br /></div>
<div class="normal">
First you have to go to the android sdk tools directory
using :<br />
<br /></div>
<div class="normal">
cd “path to android sdk tools directory”<br />
<br /></div>
<div class="normal">
Ex:<br />
<script src="https://gist.github.com/chamika/9566499.js"></script>
</div>
<div class="normal">
<br />
Then check whether the lint is working properly by running this
command:<br />
<br /></div>
<script src="https://gist.github.com/chamika/9566651.js"></script>
<br />
<div class="normal">
<br />
If you experience an exception similar to “exception in thread
"main" java.lang.NoClassDefFoundError: lombok/ast/AstVisitor”<br />
go to
\android-sdk-windows\tools\lib and rename lombok-ast-0.2.2.jar (or with
a different version) to new file name “lombok-ast.jar”</div>
<div class="normal">
Try again and it should show the version of Lint<br />
<br /></div>
<div class="normal">
Now check for unused resources by</div>
<div class="normal">
<br />
lint --check UnusedResources
--fullpath “path to project folder (where AndroidManifest.xml is)” >
resources.txt</div>
<div class="normal">
<br />
Ex:<br />
<script src="https://gist.github.com/chamika/9566665.js"></script>
</div>
<div class="normal">
<br />
It will take some time depending on the number of project
files. After that a file named “resources.txt” will generate in the console
working directory. (If you run Lint from \android-sdk-windows\tools , the file
will be located there)<br />
<br />
<h2>
2. Remove unused resources</h2>
</div>
<div class="normal">
Open that “resources.txt” file and go through the unused file
list and delete resource files one by one. If you feel lazy for that execute
following java file/ jar file and generate batch/shell and run it. (I did that
to automate process)<br />
<br /></div>
<div class="normal">
<a href="https://drive.google.com/folderview?id=0B29zSnxX4D6pVklpOUVVb3ktNms&usp=sharing" target="_blank">Download java or source</a><br />
<br />
<br /></div>
<div class="normal">
To execute jar file run this on console</div>
<div class="normal">
<script src="https://gist.github.com/chamika/9566682.js"></script>
</div>
<div class="normal">
OS_ID : 0=windows(generate unused.bat) and 1=linux(generate
unused.sh)</div>
<div class="normal">
lint_check_resource_output_file : resources.txt file <br />
<br /></div>
<div class="normal">
Ex:<br />
java –jar lintreader.jar 0 resources.txt<br />
<br /></div>
<div class="normal">
This will generate unused.bat or unused.sh files depending on
the OS_ID you provide.</div>
<div class="normal">
<br />
Execute this generated file in the console and unused android
project resources will be deleted automatically. </div>
<div class="normal">
<br />
To execute batch file in windows simply type in command prompt</div>
<div class="normal">
<script src="https://gist.github.com/chamika/9566697.js"></script>
</div>
<div class="normal">
To execute shell script in linux simply type in console</div>
<div class="normal">
<script src="https://gist.github.com/chamika/9566715.js"></script>
</div>
<div class="normal">
<br /></div>
<div class="normal">
<br /></div>
<br />
<div class="normal">
<br /></div>
Anonymoushttp://www.blogger.com/profile/01006723763327398778noreply@blogger.com1Sri Lanka6.9270786 79.8612430000000596.8009751 79.69988150000006 7.0531821 80.022604500000057