tag:blogger.com,1999:blog-10722333631457512452024-02-07T23:11:33.184-05:00Lula's Chronicles“Share your knowledge. It is a way to achieve immortality.” - Dalai Lama XIVUnknownnoreply@blogger.comBlogger29125tag:blogger.com,1999:blog-1072233363145751245.post-50017615806930160112016-07-27T16:53:00.002-04:002016-08-01T15:25:21.989-04:00How to run Cucumber feature tests in android, quick steps for Android Studio 2.1<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="text-align: right;">
<div style="text-align: left;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: right;">
<b style="text-align: left;"><a href="http://cronicasdelula.blogspot.nl/2016/08/como-ejecutar-feature-tests-de-cucumber.html">Leer en español aquí</a> </b></div>
<b style="text-align: left;"><br /></b>
<div class="separator" style="clear: both; text-align: right;">
<a href="http://cronicasdelula.blogspot.nl/2016/08/como-ejecutar-feature-tests-de-cucumber.html"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY78iedmbPjxljnL-CoQ5ReHjCX1sJTSa1d999J-p19KQfl6-B2HAj1xy86u3eoKq3lGt_bR6EF8CBbHmbKL9fBnYpp__BIhK_cYb7hjcSFDoWolslc4R-T2wGDalM1Q9xXZoo6TN3uwM/s1600/spanish-flag-small.gif" /></a></div>
</div>
</div>
<br />
<br />
<br />
These steps are not for UI tests, if you want to do acceptance tests emulating user interaction with the UI better use <a href="http://calaba.sh/">Calabash</a>.<br />
<br />
<br />
<ol style="text-align: left;">
<li>Create a new android project in Android Studio.<br /> </li>
<li>Open build.gradle and add the following dependencies<br /><br /><pre style="background-color: white; font-family: Menlo; font-size: 9pt;">androidTestCompile <span style="color: green; font-weight: bold;">'junit:junit:4.12'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'cucumber-java'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'1.2.2'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'cucumber-core'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'1.2.2'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'cucumber-html'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'0.2.3'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'cucumber-jvm-deps'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'1.0.3'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'gherkin'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'2.12.2'</span>
androidTestCompile <span style="color: green; font-weight: bold;">'info.cukes:cucumber-android:1.2.0@jar'</span>
androidTestCompile <span style="color: green; font-weight: bold;">group</span>: <span style="color: green; font-weight: bold;">'info.cukes'</span>, <span style="color: green; font-weight: bold;">name</span>: <span style="color: green; font-weight: bold;">'cucumber-junit'</span>, <span style="color: green; font-weight: bold;">version</span>: <span style="color: green; font-weight: bold;">'1.2.2'</span></pre>
<br />it must be that exact version in all cucumber libraries, the latest version doesn't work due to they are compiled with java8, and java8 is not supported yet in android (soon, soon, we hope)<br /><br /> </li>
<li>We need to setup in gradle that the tests will be executed using Cucumber. Add the instrumentation runner in build.gradle, in the defaultConfig setup<br /><br /><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><span style="color: #999999;">defaultConfig {
applicationId <span style="font-weight: bold;">"my.application.package"</span><span style="font-weight: bold;"> </span>minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName <span style="font-weight: bold;">"1.0"</span></span><span style="color: green; font-weight: bold;">
</span> testInstrumentationRunner <span style="color: green; font-weight: bold;">"cucumber.api.android.CucumberInstrumentation"
</span><span style="color: #999999;">}
</span></pre>
</li>
<li>Create a new assets folder for the cucumber features in <b>src/androidTest/assets<br /> </b></li>
<li>This new folder is not recognized by gradle yet, set the new assets folder in build.gradle exactly, e.g. below the defaultConfig<br /><br /><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><span style="color: #999999;">defaultConfig {
...
}
</span>sourceSets {
androidTest {
assets.srcDirs = [<span style="color: green; font-weight: bold;">'src/androidTest/assets'</span>]
}
}
</pre>
</li>
<li>Create a new folder named "<b>features</b>" in the assets folder. All the feature files will stored be here (you can use subfolders). Example of a feature, can be on any file, cucumber doesn't care about the name of the file:<br /><br /><pre style="background-color: white; font-family: Menlo; font-size: 9pt;">Feature: Calculator
Scenario Outline: a simple sum
Given I have numbers 2 and 3
When I sum
Then the result is 5
</pre>
</li>
<li><b>This is an important step</b>. Create your tests in the subpackage "test" of your main package id, e.g. <span style="color: #999999;">my.application.package</span>.test<br /><br />A test example for the previous feature:<br /><br /><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><span style="color: olive;">@CucumberOptions</span>(features = <span style="color: green; font-weight: bold;">"features"</span>)
<span style="color: navy; font-weight: bold;">public class </span>CalculatorFeatureTest {
<span style="color: navy; font-weight: bold;">private int </span><span style="color: #660e7a; font-weight: bold;">mNum1</span>;
<span style="color: navy; font-weight: bold;">private int </span><span style="color: #660e7a; font-weight: bold;">mNum2</span>;
<span style="color: navy; font-weight: bold;">private int </span><span style="color: #660e7a; font-weight: bold;">mResult</span>;
<span style="color: olive;">@Given</span>(<span style="color: green; font-weight: bold;">"^I have numbers (-*</span><span style="color: navy; font-weight: bold;">\\</span><span style="color: green; font-weight: bold;">d+) and (-*</span><span style="color: navy; font-weight: bold;">\\</span><span style="color: green; font-weight: bold;">d+)$"</span>)
<span style="color: navy; font-weight: bold;">public void </span>i_have_numbers_and(<span style="color: navy; font-weight: bold;">int </span>n1, <span style="color: navy; font-weight: bold;">int </span>n2) <span style="color: navy; font-weight: bold;">throws </span>Throwable {
<span style="color: #660e7a; font-weight: bold;">mNum1 </span>= n1;
<span style="color: #660e7a; font-weight: bold;">mNum2 </span>= n2;
}
<span style="color: olive;">@When</span>(<span style="color: green; font-weight: bold;">"^I sum$"</span>)
<span style="color: navy; font-weight: bold;">public void </span>i_sum() <span style="color: navy; font-weight: bold;">throws </span>Throwable {
<span style="color: #660e7a; font-weight: bold;">mResult </span>= <span style="color: #660e7a; font-weight: bold;">mNum1 </span>+ <span style="color: #660e7a; font-weight: bold;">mNum2</span>;
}
<span style="color: olive;">@Then</span>(<span style="color: green; font-weight: bold;">"^the result is (-*</span><span style="color: navy; font-weight: bold;">\\</span><span style="color: green; font-weight: bold;">d+)$"</span>)
<span style="color: navy; font-weight: bold;">public void </span>the_result_is(<span style="color: navy; font-weight: bold;">int </span>result) <span style="color: navy; font-weight: bold;">throws </span>Throwable {
<span style="font-style: italic;">assertEquals</span>(<span style="color: #660e7a; font-weight: bold;">mResult</span>, result);
}
}</pre>
<br />The annotation @CucumberOptions specifies the folder inside the assets for all the feature files, in this case "features"<br /> </li>
<li>Right click the package with the tests, and choose "Run tests in ..."<br /> </li>
<li>You are done</li>
</ol>
<div>
I created these steps after reading <a href="http://mdzyuba.blogspot.nl/2015/01/cucumber-jvm-and-android-studio.html">http://mdzyuba.blogspot.nl/2015/01/cucumber-jvm-and-android-studio.html</a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-1072233363145751245.post-33294480996643489022016-07-02T15:31:00.000-04:002016-08-02T03:32:08.611-04:00Be careful, Kotlin includes dead code in generated bytecode.<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="text-align: right;">
<div style="text-align: left;">
<div style="text-align: right;">
<b style="text-align: left;"><a href="http://cronicasdelula.blogspot.nl/2016/08/kotlin-incluye-codigo-muerto-en-el.html">Leer en español aquí </a></b></div>
<b style="text-align: left;"><a href="http://cronicasdelula.blogspot.nl/2016/08/kotlin-incluye-codigo-muerto-en-el.html"><br /></a></b>
<div class="separator" style="clear: both; text-align: right;">
<a href="http://cronicasdelula.blogspot.nl/2016/08/kotlin-incluye-codigo-muerto-en-el.html"><img alt="http://cronicasdelula.blogspot.nl/2016/08/kotlin-incluye-codigo-muerto-en-el.html" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY78iedmbPjxljnL-CoQ5ReHjCX1sJTSa1d999J-p19KQfl6-B2HAj1xy86u3eoKq3lGt_bR6EF8CBbHmbKL9fBnYpp__BIhK_cYb7hjcSFDoWolslc4R-T2wGDalM1Q9xXZoo6TN3uwM/s1600/spanish-flag-small.gif" /></a></div>
<div>
<br /></div>
</div>
</div>
<br />
I enjoyed two Kotlin presentations. Both combined describe the best of this new language.<br />
<br />
<br />
<ul style="text-align: left;">
<li>Advancing Android development with Kotlin<br /><a href="https://realm.io/news/oredev-jake-wharton-kotlin-advancing-android-dev">https://realm.io/news/oredev-jake-wharton-kotlin-advancing-android-dev</a></li>
</ul>
<br />
<ul style="text-align: left;">
<li>Kotlin bytecode generation and runtime performance<br /><a href="http://www.slideshare.net/intelliyole/kotlin-bytecode-generation-and-runtime-performance">http://www.slideshare.net/intelliyole/kotlin-bytecode-generation-and-runtime-performance</a></li>
</ul>
<br />
<br />
<br />
There is one thing not covered by those presentations, it is a tiny detail in how Kotlin generates the bytecode:<br />
<br />
<div style="text-align: center;">
<i><b>Kotlin inlined functions include dead code in the generated bytecode.</b></i></div>
<br />
<br />
<br />
Not a big issue when using Proguard or similar tool to optimize/shrink the classes, but in in case of Android development sometimes is needed to avoid proguard optimization/shrink due to the complexity of the project, libraries, etc.<br />
<br />
<h3 style="text-align: left;">
An example showing code and bytecode in Java and Kotlin</h3>
<br />
Let's see an example. We want to log debug messages, but we dont want to include code for debugging purposes in the bytecode of the release build:<br />
<ul style="text-align: left;">
<li>In java we call a log method inside a condition checking for a boolean constant, so the compiler ignores the code in the release build when the constant is false.</li>
<li>In Kotlin we use the advantage of inlined functions, we dont need to always include the condition when calling the log method. The function to log the message is the following<br /><br /><pre style="background-color: white; font-family: menlo; font-size: 9pt;"><span style="color: navy; font-weight: bold;">inline fun </span>debug(func: () -> String) {
<span style="color: navy; font-weight: bold;">if </span>(BuildConfig.<span style="color: #660e7a; font-style: italic;">DEBUG</span>) {
<span style="font-style: italic;">println</span>(func())
}
}</pre>
</li>
</ul>
<br />
<br />
We log the message inside a method named "doSomething"<br />
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Java</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><span style="color: navy; font-weight: bold;">void </span>doSomething() {
<span style="color: navy; font-weight: bold;">if </span>(BuildConfig.<span style="color: #660e7a; font-style: italic; font-weight: bold;">DEBUG</span>) {
System.<span style="color: #660e7a; font-style: italic; font-weight: bold;">out</span>.println(<span style="color: green; font-weight: bold;">"This is a debug message"</span>);
}
}</pre>
</td>
</tr>
</tbody></table>
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Kotlin</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><span style="color: navy; font-weight: bold;">fun </span>doSomething() {
<span style="font-style: italic;">debug </span><span style="font-weight: bold;">{ </span><span style="color: green; font-weight: bold;">"This is a debug message" </span><span style="font-weight: bold;">}</span></pre>
<pre style="background-color: white; font-family: Menlo; font-size: 9pt;">}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
+1 for Kotlin, cleaner code.<br />
<br />
In java to have a cleaner code we could create a static utility method named "debug" and put the condition inside, but the compiler will include all the calls to "debug" in the bytecode of the release build. Even after optimizing with proguard the method calls will be removed, but not the parameters, depending on how many optimization passes we define in proguard.properties<br />
<br />
<br />
<h3 style="text-align: left;">
Let's check now the bytecode generated by Java and Kotlin compilers.</h3>
<br />
To analyze the bytecode I use the plugin for IntelliJ/Eclipse made by the creators of the ASM library, the <a href="http://asm.ow2.org/">OW2 Consortium</a>. I could use the Kotlin plugin included in IntelliJ in menu <b>Tools -> Kotlin -> Show Kotlin Bytecode</b> but it doesnt add an option to ignore the line numbers, unused labels and stack information.<br />
<br />
<br />
Generated bytecode when <b>DEBUG</b> constant is <b>true</b><br />
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Java</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"> void doSomething() {
<b>getstatic</b> <span style="color: #38761d;">'BuildConfig.DEBUG'</span>,<span style="color: #38761d;">'Z'</span>
<b>ifeq</b> <span style="color: #741b47;">l0</span>
<b>getstatic</b> <span style="color: #38761d;">'java/lang/System.out'</span>,<span style="color: #38761d;">'Ljava/io/PrintStream;'</span>
<b>ldc</b> <span style="color: #38761d;">"This is a debug message"</span>
<b>INVOKEVIRTUAL</b> java/io/PrintStream.println (Ljava/lang/String;)V
<span style="color: #741b47;">l0</span>
<b>return</b>
}
</pre>
</td>
</tr>
</tbody></table>
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Kotlin (useless bytecode is <u>underlined</u>)</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"> public final static void doSomething() {
<b><u>nop</u></b>
<b>getstatic</b> <span style="color: #38761d;">'BuildConfig.DEBUG'</span>,<span style="color: #38761d;">'Z'</span>
<b>ifeq</b> <span style="color: #741b47;">l0</span>
<b>ldc</b> <span style="color: #38761d;">"This is a debug message"</span>
<u><b>astore</b> 0</u>
<b><u>nop</u></b>
<b>getstatic</b> <span style="color: #38761d;">'java/lang/System.out'</span>,<span style="color: #38761d;">'Ljava/io/PrintStream;'</span>
<u><b>aload</b> 0</u>
<b>INVOKEVIRTUAL</b> java/io/PrintStream.println (Ljava/lang/Object;)V
<span style="color: #741b47;">l0</span>
<b>return</b>
}
</pre>
</td>
</tr>
</tbody></table>
<br />
+1 for Java.<br />
<br />
Why? The difference is small but Kotlin includes some useless nops and the loading of the string "This is a debug message" is a bit dumb, loads the string, stores it, and loads it again.<br />
<br />
<br />
<br />
Generated bytecode when <b>DEBUG</b> constant is <b>false</b><br />
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Java</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"> void doSomething() {
<b>return</b>
}
</pre>
</td>
</tr>
</tbody></table>
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Kotlin (dead code is <u>underlined</u>)</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"> public final static void doSomething() {
<b>nop</b>
<b>iconst_0</b>
<b>ifeq</b> <span style="color: #741b47;">l0</span>
<u> <b>ldc</b> <span style="color: #38761d;">"This is a debug message"</span>
<b>astore</b> 0
<b>nop</b>
<b>getstatic</b> <span style="color: #38761d;">'java/lang/System.out'</span>,<span style="color: #38761d;">'Ljava/io/PrintStream;'</span>
<b>aload</b> 0
<b>INVOKEVIRTUAL</b> java/io/PrintStream.println (Ljava/lang/Object;)V</u>
<span style="color: #741b47;">l0</span>
<b>return</b>
}
</pre>
</td>
</tr>
</tbody></table>
<br />
+1 for Java, the java compiler ignores the code inside the condition, but Kotlin does a copy/paste of the code when inlining the function, not taking into account the value of the constant is always false.<br />
<br />
<br />
<h3 style="text-align: left;">
A better approach using gradle flavors</h3>
<br />
What I recommend to do for Kotlin is, instead of checking for a constant, to use gradle flavors, the debug method in the flavor for the debug build shows the message, the debug method in the flavor for the release build does nothing.<br />
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Debug flavor</th>
<th>Release flavor</th>
</tr>
<tr>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><pre style="font-family: menlo; font-size: 9pt;"><span style="color: navy; font-weight: bold;">inline fun </span>debug(func: () -> String) {
<span style="font-style: italic;">println</span>(func())
}</pre>
</pre>
</td>
<td><pre style="background-color: white; font-family: Menlo; font-size: 9pt;"><pre style="font-family: menlo; font-size: 9pt;"><span style="color: navy; font-weight: bold;">inline fun </span>debug(func: () -> String) {
}</pre>
</pre>
</td></tr>
</tbody></table>
<br />
<br />
Using it in this way we produce clean code and clean bytecode.<br />
<br />
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Kotlin Bytecode: Debug flavor</th>
</tr>
<tr>
<td><pre style="font-family: menlo; font-size: 9pt;"> public final static void doSomething() {
<b>nop</b>
<b>ldc</b> <span style="color: #38761d;">"This is a debug message"</span>
<b>astore</b> 0
<b>nop</b>
<b>getstatic</b> <span style="color: #38761d;">'java/lang/System.out'</span>,<span style="color: #38761d;">'Ljava/io/PrintStream;'</span>
<b>aload</b> 0
<b>INVOKEVIRTUAL</b> java/io/PrintStream.println (Ljava/lang/Object;)V
<b>return</b>
}
</pre>
</td>
</tr>
</tbody></table>
<br />
<table align="center" border="1" cellpadding="10" cellspacing="0" style="width: 90%;">
<tbody>
<tr>
<th>Kotlin Bytecode: Release flavor</th>
</tr>
<tr>
<td><pre style="font-family: menlo; font-size: 9pt;"> public final static void doSomething() {
<b>nop</b>
<b>return</b>
}
</pre>
</td></tr>
</tbody></table>
<pre style="background-color: white; font-family: menlo; font-size: 9pt;"></pre>
<br />
<br />
Kotlin adds a useless nop in the bytecode generated by the release flavor but is clean enough for our needs.<br />
<br />
<br />
Are we solving a big issue here? Not really, but these small details help us to create clean code without adding an overhead in the compiled classes.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-1072233363145751245.post-89945039287980823632016-06-21T23:13:00.000-04:002016-08-02T12:54:58.619-04:00Git: How to move a folder to a new empty repository, with history included<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: right;">
<b style="text-align: left;"><a href="http://cronicasdelula.blogspot.nl/2016/08/git-mover-una-carpeta-otro-repositorio.html">Leer en español aquí </a></b></div>
<a href="http://cronicasdelula.blogspot.nl/2016/08/git-mover-una-carpeta-otro-repositorio.html"><br /></a>
<br />
<div class="separator" style="-webkit-text-stroke-width: 0px; clear: both; color: black; font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; text-align: right; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;">
<a href="http://cronicasdelula.blogspot.nl/2016/08/git-mover-una-carpeta-otro-repositorio.html"><img alt="http://cronicasdelula.blogspot.nl/2016/08/kotlin-incluye-codigo-muerto-en-el.html" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY78iedmbPjxljnL-CoQ5ReHjCX1sJTSa1d999J-p19KQfl6-B2HAj1xy86u3eoKq3lGt_bR6EF8CBbHmbKL9fBnYpp__BIhK_cYb7hjcSFDoWolslc4R-T2wGDalM1Q9xXZoo6TN3uwM/s1600/spanish-flag-small.gif" /></a></div>
<br />
<br />
I will not write an introduction of why we need to do this. This is how I did it, not sure if it is the best way but worked 100%:<br />
<div>
<br /></div>
<div>
I used the git commands described in this great article <a href="https://help.github.com/articles/remove-sensitive-data/">https://help.github.com/articles/remove-sensitive-data/</a></div>
<div>
<br /></div>
<div>
<ol style="text-align: left;">
<li> Two repos: REPO_OLD with the folder I want to move, REPO_NEW an empty repository where I will move the folder<br /> </li>
<li>Copy everything (.git folder included) from REPO_OLD to REPO_NEW (another way is to clone REPO_OLD into a new folder REPO_NEW)<br /> </li>
<li><b><u>DONT FORGET THIS:</u></b> Remove the origin in REPO_NEW: <b>git remote rm origin<br /> </b></li>
<li>Delete in REPO_NEW all folders you DONT need. E.g. folder name is FOLDER then<br /><br />
<div class="p1">
<span class="s1"><b>git filter-branch --force --index-filter ' git rm --cached --ignore-unmatch -r FOLDER/ ' --prune-empty --tag-name-filter cat -- --all</b><br /><br />do it with all the folders one by one, at the end only the folder you need should be in REPO_NEW. If some folders still exist it is due to some files were not added to git, you can delete the folders manually, they are not in the git history anymore.<br /> </span></div>
</li>
<li><div class="p1">
<span class="s1">Now set origin in REPO_NEW to the remote repository where you want to push this new repo.<br />
</span></div>
<div class="p1">
<span class="s1">E.g. <b>git remote add origin git@bitbucket.org:someuser/REPO_NEW.git </b><br /> </span></div>
</li>
<li><div class="p1">
<span class="s1">Push everything forcing overwrite history: </span><b>git push origin --force --all<br /> </b></div>
</li>
<li>Ok, it is copied, but not moved. Just delete the folder in REPO_OLD using the same command you used in step 4.<br /> </li>
<li><div class="p1">
Done</div>
</li>
</ol>
<div>
<br />
<br /></div>
</div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-75870356287943408512016-05-15T19:40:00.002-04:002016-05-15T19:40:46.529-04:00Released a new android app: Radar Stats for LoL<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hi all,<br />
<br />
I created a new app to analyze my games in League of Legends. I hope you enjoy it as I do.<br />
<br />
The link to Google Play: <a href="https://play.google.com/store/apps/details?id=ar.ignaciotcrespo.lolradar">https://play.google.com/store/apps/details?id=ar.ignaciotcrespo.lolradar</a><br />
<br />
And the webpage: <a href="http://lolradarstats.com/">http://lolradarstats.com/</a><br />
<br />
Some screenshots:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik5LbVJIwUbfDtixnhuekHVgYlWlcLQtlxUu4dU5l51EzSEDSHY9Y71rzbc8Q8M0D7omdYI27KTZykJ_40P-c2x5JKm9GpNv8gRDvAANfYDhc9Oo0A44mSkXMxYW0xyDEQrre13xfUm2k/s1600/shot1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik5LbVJIwUbfDtixnhuekHVgYlWlcLQtlxUu4dU5l51EzSEDSHY9Y71rzbc8Q8M0D7omdYI27KTZykJ_40P-c2x5JKm9GpNv8gRDvAANfYDhc9Oo0A44mSkXMxYW0xyDEQrre13xfUm2k/s320/shot1.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSRMQT7C86CKDDzeSWToLGC0cG2svLPw6BJhGqiinTKZy61jU0e2JAON3waneiOWE91Dn73STMaiegXjAjgp-KSHLJov_E_rAxebXpf30c5cfZ9VdBQZzxt0CCf6V5Iut-l5col0Modqc/s1600/shot2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSRMQT7C86CKDDzeSWToLGC0cG2svLPw6BJhGqiinTKZy61jU0e2JAON3waneiOWE91Dn73STMaiegXjAjgp-KSHLJov_E_rAxebXpf30c5cfZ9VdBQZzxt0CCf6V5Iut-l5col0Modqc/s320/shot2.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh50ZiHjAv_9Uu0brBUnVH3_CsYRA3L_Ou1uNNncprhLP0LSr_0aELFbQPkQSx7ktRDu5LX717hccCmloZxPgf28dCspg8-6asq9ZPNR7iJzbLIOkco4V4gDtkZI2-_rJ-aM1BCBRYtd_8/s1600/shot3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh50ZiHjAv_9Uu0brBUnVH3_CsYRA3L_Ou1uNNncprhLP0LSr_0aELFbQPkQSx7ktRDu5LX717hccCmloZxPgf28dCspg8-6asq9ZPNR7iJzbLIOkco4V4gDtkZI2-_rJ-aM1BCBRYtd_8/s320/shot3.jpg" width="180" /></a>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcLRFZl5pCZNRlZt_C8ZYZkq_HaTUAVdZxCGvpnMxGh7Ybf-E_Ww4cS8nUGB7M4jJLJ9tGgsq7ryr7Yew9T6Ep3376GwgS5I0XBo5MpJXwC_zIjC7-5QohretINa3eM0tjoCToA7z2ri4/s1600/shot4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcLRFZl5pCZNRlZt_C8ZYZkq_HaTUAVdZxCGvpnMxGh7Ybf-E_Ww4cS8nUGB7M4jJLJ9tGgsq7ryr7Yew9T6Ep3376GwgS5I0XBo5MpJXwC_zIjC7-5QohretINa3eM0tjoCToA7z2ri4/s320/shot4.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBH-B0dS0t-YcvNLK3G_KWzDvm6KiDoh3fWuUmY2b2QAREFPR63DIMW9qLAW0DdI-Rwy5RwsCdPSWr83KaefBxec_yIPImzNTRs4jPXKZ5hcXVP1oQyXUlmQ8RXGWOiYIfOEKW8eNit-Y/s1600/shot5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBH-B0dS0t-YcvNLK3G_KWzDvm6KiDoh3fWuUmY2b2QAREFPR63DIMW9qLAW0DdI-Rwy5RwsCdPSWr83KaefBxec_yIPImzNTRs4jPXKZ5hcXVP1oQyXUlmQ8RXGWOiYIfOEKW8eNit-Y/s320/shot5.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrHfPP8Z1GqfxhlgSv1seEbQmAuSDLT3KQ9yGZdHpRnx1-1pmhtLoNl2Pa1A_yipedjYTIVzZHEdnfaUAsBRuofKXZOaWqGS-oDH9rYt4AMCOYTNVDefizlkhkI8WW51g4BHKG1heMOOA/s1600/shot6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrHfPP8Z1GqfxhlgSv1seEbQmAuSDLT3KQ9yGZdHpRnx1-1pmhtLoNl2Pa1A_yipedjYTIVzZHEdnfaUAsBRuofKXZOaWqGS-oDH9rYt4AMCOYTNVDefizlkhkI8WW51g4BHKG1heMOOA/s320/shot6.jpg" width="180" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVcCCZJZXoF1UJtzpGKG11D7cZx_b0L_IeuA1o4hp-c3zTUvI1uFY5axt9g9WdaxuCX3xw4ah7_A2JS_0TU7PBVtVviNCJbtbgSiQrnnzUXzYRnKJZ7SDpYzEPHzXLZYiPHzihIgzJJNs/s1600/shot7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVcCCZJZXoF1UJtzpGKG11D7cZx_b0L_IeuA1o4hp-c3zTUvI1uFY5axt9g9WdaxuCX3xw4ah7_A2JS_0TU7PBVtVviNCJbtbgSiQrnnzUXzYRnKJZ7SDpYzEPHzXLZYiPHzihIgzJJNs/s320/shot7.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo8Jh0Kj8Wi0TC6Ii1zDZDHWVRfkCI1EMNwx0VGWFYgx_qKORkRPl_C25H3AlmGpl-F0_DBOVZjHW2gZ1rPr4SNs2iP5l3nxs7ywHdJZ_XEi7vn-2apiUKPgPqnjTZc_PeFhDMpnrlbvU/s1600/shot8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo8Jh0Kj8Wi0TC6Ii1zDZDHWVRfkCI1EMNwx0VGWFYgx_qKORkRPl_C25H3AlmGpl-F0_DBOVZjHW2gZ1rPr4SNs2iP5l3nxs7ywHdJZ_XEi7vn-2apiUKPgPqnjTZc_PeFhDMpnrlbvU/s320/shot8.jpg" width="180" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMO9rry46Tv9_JUdygUpyPDFjaphkH9KTQoA4yl-5lP-YSiuJjPwpwns3m5RQ5avK8btO1LA8-8Qvl4gYHKk8Q8wyDcBqniGTCjBGsBVP4F45B3SiwmHnWdPXPq3lfKZ-n3hLtGGVQpuM/s1600/shot9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMO9rry46Tv9_JUdygUpyPDFjaphkH9KTQoA4yl-5lP-YSiuJjPwpwns3m5RQ5avK8btO1LA8-8Qvl4gYHKk8Q8wyDcBqniGTCjBGsBVP4F45B3SiwmHnWdPXPq3lfKZ-n3hLtGGVQpuM/s320/shot9.jpg" width="180" /></a></div>
<br />
<br />
Later I will describe which libraries I am using in the app.<br />
<br />
Any feedback is welcome.<br />
<br />
Lula<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-60167655356960121792016-02-22T17:10:00.000-05:002016-08-03T03:39:26.073-04:00New Experimental Project: Radar Stats for League of Legends<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<strike>I play League of Legends. A lot. It is my new drug (I started 3 years ago). I enjoy it more than any other game.</strike> Update: I dont play it anymore, I have a family :)<br />
<br />
There are many applications on internet showing the game statistics: kills, deaths, assists, damage, etc. but none of those applications show the stats in the exact way I need it. What I want to see:<br />
<br />
- A radar spiderweb of both teams, showing all kind of stats, and the evolution during the entire game. Similar to the radar graphs used by basketball websites to analyze the game.<br />
- A map showing how both teams moved, the path they followed, were they did the kills, the area covered by both teams, and more. To do this LoL API has data in frames, separated in minutes, so it is not exact but it gives an idea of how the enemy jungle started (and killed me :0 ).<br />
- Open the match details in the official lol history, or in LolKing.net<br />
- Share the match details with friends<br />
<br />
I created an android app with those features. The UI is bad, but I am focused on the functionality, after every game I analyse the graphs and discover my mistakes, the good moves of my enemies, and learn. I can not say I became a better player because of the app, but I am playing better trying to avoid the same mistakes the graphs showed to me. Sometimes it works, and I enjoy watching the graphs and the maps many times.<br />
<br />
The <a href="https://developer.riotgames.com/">LoL API</a> doesnt return all stats in the timeline (e.g. we can not see the evolution of the total damage), but it has enough data to play with it.<br />
<br />
<strike>I uploaded an alpha build to the store, you can download here it after joining as an alpha user <a href="https://play.google.com/apps/testing/ar.ignaciotcrespo.lolradar">https://play.google.com/apps/testing/ar.ignaciotcrespo.lolradar</a></strike><br />
<br />
UPDATE: I released it some months ago, the link is <a href="https://play.google.com/store/apps/details?id=ar.ignaciotcrespo.lolradar">https://play.google.com/store/apps/details?id=ar.ignaciotcrespo.lolradar</a><br />
<br />
For developers, some useful libraries I used to create the app:<br />
<br />
- <a href="https://github.com/PhilJay/MPAndroidChart">MPAndroidChart</a>: excellent library to display charts in android.<br />
- <a href="http://square.github.io/picasso/">Picasso</a>: very good image loader, very easy to use. Some issues present (memory leaks sometimes) but nothing critical.<br />
- <a href="https://github.com/lopspower/CircularImageView">CircularImageView</a>: show circular images with almost no code.<br />
- GSON: to parse the LoL statistics in json format, and convert them to business objects.<br />
- Guava: always useful, maybe too big for android, but this app is small.<br />
<br />
<br />
Screenshots: (UPDATE: these screenshots are old, the new app has a different UI)<br />
<br />
<br />
<div style="text-align: center;">
A radar chart showing the stats of each line, both teams compared
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZtR1JSf2TLqtFpDQlZ8_DLOwUsMlj0RRmrpUmigsZKh33wldENeJao5xzam06Zu3oLFSk0sodsv16Dr9_PjWZIlLtDOG7CNR4oNvlM6oUwqT4_6RSSBq6HM4w7G1MqWcilY27MVeYj04/s400/screen2.png" width="257" />
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
You can select 2 players and compare their gold, kda, wards, cs and objectives.
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuIhyphenhyphenuvVuTZuipYzrHSgCBhqdEaLGElUKyKXuKQXMMHn4fMWBozOdevww5lp3bEW4j1VFhifNomlxQxilwjfJLNTp98F4O016V9h_L_qQbkmRnwNmu-3p0hiA4yGZsHTzMQQLhfCwKCfk/s400/screen.png" width="255" />
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
A heatmap shows the position of all players during the match. It can be changed to different kind of graphs, and see the evolution on every minute during the game.
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpXgOONCOhXVYxshcYSCo5tlxNjBPHb8jyh7CaYoJ3aM080VzJpVG750Vi79RS5vJkK8f_0FOXn6doeLMrib_ba8059j72fQPTAtEy4BmBfd7p6Kldf6AMzI2R2XwmWTLxwqyKgeU_2rY/s400/screen4.png" width="257" />
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
You can select 2 players in the map and choose "Show path" to see live the path they did during the entire game.
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<img alt="https://goo.gl/JJHSmb" border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikdtgU7RMcjhOfyDw5mqNKTePeI57cEHmLI9Q_KlTV7mImBvCsF8upy3Xp7lIEOnG2AlR5vvwmIMCWSsRCzQ6K_zkjC_pIiIZYyQn0A9mvIhpkiPM6_Kol_paYWkFqg9zdVkLnu7KQffA/s400/screen5.png" width="256" />
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
And of course the list of recent matches.
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2nJXqQmZYxqJBdZhsJtSkl1Hac8FEOBR1Ykh6mRAsO-y-Tgz3YPaRuxPMsFaXSvJNP7092Kumdd6gluNykd4uns70fz_JK-TEjeBAux5VnbhfTN2FclPIcZCu-o83LlmpT4TXCHru6wA/s1600/screen3.png" imageanchor="1">
<img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2nJXqQmZYxqJBdZhsJtSkl1Hac8FEOBR1Ykh6mRAsO-y-Tgz3YPaRuxPMsFaXSvJNP7092Kumdd6gluNykd4uns70fz_JK-TEjeBAux5VnbhfTN2FclPIcZCu-o83LlmpT4TXCHru6wA/s400/screen3.png" width="257" />
</a>
</div>
<br />
<br />
<br />
I am still working on it. <strike>It is an alpha so it has bugs</strike>. There are many things to improve, any feedback is welcome.
<br />
<br />
<br />
Enjoy Lol.
<br />
<br />
<strike><br /></strike>
<strike>PD: if you want to play with me, my nick is "nippur" in EUW.</strike><br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-23817708516810783562014-01-26T07:07:00.003-05:002014-01-26T15:08:04.614-05:00Just when you thought you knew a lot about development...<div dir="ltr" style="text-align: left;" trbidi="on">
Just when you thought you knew a lot about development someone that knows more punch you directly in the face with a few wise words.<br />
<br />
A friend recommended me "Clean Code" and "Clean Coder", by Robert Martin.<br />
<br />
<a href="http://www.objectmentor.com/omTeam/martin_r.html">http://www.objectmentor.com/omTeam/martin_r.html</a><br />
<br />
I feel like a child learning everything again. I love these books, it is the kind of technical thing that you need to read before going to sleep.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-84550958690347797432012-11-14T10:26:00.001-05:002012-11-14T10:26:37.275-05:00Android SDK Manager can't find latest updates!<div dir="ltr" style="text-align: left;" trbidi="on">
I had a nice surprise today. After updating the ADT plugin in Eclipse it says that I must update the android tools.<br />
<br />
Ok, one more time I opened the SDK Manager and searched for the updates. But wait... there is no updates. And Eclipse doesn't work! WTF?<br />
<br />
"It must be a bad nightmare, take it easy" I think. Just do the obvious thing, close the SDK Manager and open it again. Stupid solution, it doesn't work.<br />
<br />
Ok, something is bad, so I enter to the preferences and what I see is "Cache size" with the option "Delete cache". Oh yea! Now it works. God exists.<br />
<br />
Stupid cache, you think you know everything, but I am better than you :D<br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1072233363145751245.post-16674403968814525342012-11-06T03:03:00.002-05:002012-11-06T10:38:22.659-05:00Development tools I can't live without<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Every developer has his own set of preferred tools. Me too. In my case all these tools are Java oriented because is the language I use more often. Obviously these are not the best tools you can find on internet, I'm sure you use other tools better and you hate my tools, but they gave me so many satisfactions that I think my work can't be finished without them. Too bad uh?<br />
<br />
<ul style="text-align: left;">
<li><a href="http://www.eclipse.org/">Eclipse</a>: "naaaaaaaaaaa, no way" maybe you think. I understand people complaining this fantastic IDE, but I am in love with this tool. I tried all IntelliJ, Netbeans, etc. and I think I know Eclipse so well that I can face any problem that it can have, I accept it's buggy due to the free plugins we install all the time.</li>
<li><a href="http://findbugs.sourceforge.net/">Findbugs</a>: great free tool to detect common programming problems.</li>
<li><a href="http://checkstyle.sourceforge.net/">CheckStyle</a>: the best tool to detect coding standard violations. I use it inside Eclipse of course.</li>
<li><a href="http://www.ucdetector.org/">UCDetector</a>: Unused Code Detector. When your project it's really big you notice a lot of code that it is not being used. You can remove it automatically with proguard, but the best option is to delete it. Less code, less problems. This free Eclipse plugin will do the hard work for you, with many options, and allowing to remove multiple things with quickfix.</li>
<li><a href="http://asm.ow2.org/eclipse/index.html">ASM Bytecode Plugin</a>: amazing plugin to see the java bytecode in real time. Sometimes when you want to improve something it is good to check the bytecode, you will get some nice surprises. You can change the code, but the bytecode could be exactly the same or even worst.</li>
<li><a href="http://tools.android.com/tips/lint">Lint</a>: checks for problems in Android projects. It is included in the android SDK and the ADT plugin.</li>
<li><a href="http://www.ghisler.com/">Total Commander</a>: wtf? This is not for java. Of course not, it is only THE file commander. Extremely powerful, and with lot of free plugins. It's for windows only but I use it with "wine" in MacOS. If you create a plugin the author will send you a personal license for free! Thanks Ghisler, you made me happy on christmas ;)</li>
<li><a href="http://www.sonarsource.org/">Sonar</a>: easily receive reports with code coverage and errors.</li>
<li><a href="http://plantuml.sourceforge.net/">PlantUML</a>: combined with Javadoc is an amazing tool to add UML graphs to your documentation.</li>
<li>Google: do I need to put the link? When you don't know something he knows it :D</li>
</ul>
<div>
And the last thing I can say is: use the tools that are more comfortable for you, and use them well and wisely. You will love your daily job.</div>
<div>
<br /></div>
<div>
Cheers,</div>
<div>
<br /></div>
<div>
Lula</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-40896868822758439012011-10-23T22:34:00.001-04:002016-08-03T03:33:44.491-04:00NoooTvAndroid: see all movies from Noo TV in your android<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote class="tr_bq">
<b><i>UPDATE 3/Aug/2016:<br />this was an experimental project I created some years ago, it is not functional anymore and I am not doing support. Thanks for all the feedback.</i></b></blockquote>
<br />
<br />
Hi all,<br />
<br />
I did an application to see the movies from Nooo TV in your Android. It's similar to CuevanAndroid, I hope you can enjoy it.<br />
<br />
<a href="https://market.android.com/details?id=com.shinebox.android.notv">https://market.android.com/details?id=com.shinebox.android.notv</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://ssl.gstatic.com/android/market/com.shinebox.android.notv/hi-256-0-40ea6d6005dac18c0fa97bdca65338625dcf23ba" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://ssl.gstatic.com/android/market/com.shinebox.android.notv/hi-256-0-40ea6d6005dac18c0fa97bdca65338625dcf23ba" width="200" /></a></div>
<br />
Please be patient, it's in development, if you find bugs please send me a mail and I will fix it. <br />
<br />
BR,<br />
<br />
Lula <br />
<br />
<br /></div>
Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-1072233363145751245.post-53800204583580134372011-10-19T13:55:00.001-04:002011-10-19T15:53:40.241-04:00What I want to see in Logcat plugin for EclipseThe new logcat plugin is cool, now has regex and more options to filter. But it lacks of:<br />
<br />
<ul>
<li>highlight searched text</li>
<li> syntax coloring for XML and others</li>
<li>selection of log format (brief, full, etc.) and ring buffer (main, radio, events)</li>
</ul>
I developed a small logcat plugin with those both features. Warning, this logcat plugin is ugly (I'm not a UI designer), it's just a small example.<br />
<br />
You can download it here: <a href="https://skydrive.live.com/redir.aspx?cid=511e6cc6d535b08d&resid=511E6CC6D535B08D%21123">https://skydrive.live.com/redir.aspx?cid=511e6cc6d535b08d&resid=511E6CC6D535B08D!123</a><br />
<br />
A few screenshots<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF1pBUYbgGN5kH0dJcz9az0b0aB5MLksKEyAIlrzAuwhl_adCgOUYQgcykqo3tL_ma7lcNdugy44QP7VKGl1CkjUXxuEsBT1kUBB6iwrnTEcdvGPAEY12FrS22rVs5fi_7OuifDn_uffQ/s1600/Screen+shot+2011-10-19+at+3.01.27+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="131" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF1pBUYbgGN5kH0dJcz9az0b0aB5MLksKEyAIlrzAuwhl_adCgOUYQgcykqo3tL_ma7lcNdugy44QP7VKGl1CkjUXxuEsBT1kUBB6iwrnTEcdvGPAEY12FrS22rVs5fi_7OuifDn_uffQ/s400/Screen+shot+2011-10-19+at+3.01.27+PM.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
highlight searched text in yellow</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKkxsmIUmcloEvj1Z0wLyAFqx0pekbfapBDTwJWhN_3H5UwqfSxsg5RgOgmcMuu7H5DsUcXBsjcIfABDlNvL-2sJWexOGyA7oHBrpHHvojc5P6a390izNHjbPupt3KtnutKuDmQu1vPU0/s1600/Screen+shot+2011-10-19+at+3.03.08+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="65" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKkxsmIUmcloEvj1Z0wLyAFqx0pekbfapBDTwJWhN_3H5UwqfSxsg5RgOgmcMuu7H5DsUcXBsjcIfABDlNvL-2sJWexOGyA7oHBrpHHvojc5P6a390izNHjbPupt3KtnutKuDmQu1vPU0/s400/Screen+shot+2011-10-19+at+3.03.08+PM.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
syntax highlight in XML</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I will continue using the original logcat plugin, is really great, but still has many things to improve. Congratulations to all the developers, they did a great job.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
BR,</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Lula</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-88782594016378721922011-10-13T16:52:00.000-04:002016-08-03T03:34:06.092-04:00CuevanAndroid: see all movies from Cuevana in your Android<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote class="tr_bq">
<b><i>UPDATE 3/Aug/2016:</i></b><br />
<b><i><br /></i></b>
<b><i>this was an experimental project I created some years ago, it is not functional anymore and I am not doing support. Thanks for all the feedback.</i></b></blockquote>
<br />
<br />
There is a new application in the market giving access to the well known Cuevana site. It includes the Cuevana plugin so you don't have to do anything, just enjoy the videos.<br />
<br />
Check it at <a href="https://market.android.com/details?id=com.shinebox.android.cuevana">https://market.android.com/details?id=com.shinebox.android.cuevana</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://g1.gstatic.com/android/market/com.shinebox.android.cuevana/hi-256-0-d7aa95993b3d5d4fc9aa1d876caa5a4dd54a95e2" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://g1.gstatic.com/android/market/com.shinebox.android.cuevana/hi-256-0-d7aa95993b3d5d4fc9aa1d876caa5a4dd54a95e2" /></a></div>
<br />
<br />
BR,<br />
<br />
Lula<br />
<br />
<br /></div>
Unknownnoreply@blogger.com32tag:blogger.com,1999:blog-1072233363145751245.post-75839530179298312432011-08-31T11:10:00.002-04:002011-08-31T11:10:24.885-04:00Another option to disassemble APK files<a href="http://code.google.com/p/dex2jar/">http://code.google.com/p/dex2jar/</a><br />
<br />
I didn't tested it, just found the project.<br />
<br />
BR,<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-20958188435173116702011-08-31T11:05:00.003-04:002011-08-31T11:06:31.470-04:00New DEX disassemblerCheckout this new DEX file disassembler<br />
<a href="http://www.blogger.com/goog_113738725"><br />
</a><br />
<a href="https://code.google.com/p/smali/"><tt id="checkoutcmd">https://code.google.com/p/smali/</tt></a><br />
<br />
<tt id="checkoutcmd">it looks good and has lots of options</tt><br />
<br />
<tt id="checkoutcmd">BR,</tt><br />
<br />
<tt id="checkoutcmd">Lula </tt>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-68585427691311693002011-05-31T14:15:00.000-04:002011-05-31T14:15:17.129-04:00Obfuscate android builds using proguardThe new android SDK comes with proguard included in the build system. You can check how to use it at <a href="http://developer.android.com/guide/developing/tools/proguard.html">http://developer.android.com/guide/developing/tools/proguard.html</a><br />
<br />
Not all the proguard options can be used, specially those used for optimizations. <br />
<br />
You should keep all classes used in xml files. The best way to do it is to keep classes that extend from android.content.Context due to almost everything related to android UI and services belong to the android context.<br />
<br />
After some research I give you the best proguard.cfg for almost any application.<br />
<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><i><span style="color: black;">-dontpreverify</span><br style="color: black;" /><span style="color: black;">-dontskipnonpubliclibraryclasses</span><br style="color: black;" /><span style="color: black;">-dontskipnonpubliclibraryclassmembers</span><br style="color: black;" /><span style="color: black;">-optimizations !code/simplification/arithmetic</span><br style="color: black;" /><span style="color: black;">-optimizationpasses 5</span><br style="color: black;" /><span style="color: black;">-useuniqueclassmembernames</span><br style="color: black;" /><span style="color: black;">-dontusemixedcaseclassnames</span><br style="color: black;" /><span style="color: black;">-verbose</span><br style="color: black;" /><span style="color: black;">-target 1.6</span><br style="color: black;" /><span style="color: black;"># -repackageclasses mypackage</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;">-keep public class * extends android.content.Context {</span><br style="color: black;" /><span style="color: black;"> *** <init>(...); </init></span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;">-keepclassmembers enum * {</span><br style="color: black;" /><span style="color: black;"> public static **[] values();</span><br style="color: black;" /><span style="color: black;"> public static ** valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;">-keepattributes Exceptions, InnerClasses, Signature</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Keep names - Native method names. Keep all native class/method names.</span><br style="color: black;" /><span style="color: black;">-keepclasseswithmembers,allowshrinking class * {</span><br style="color: black;" /><span style="color: black;"> native <methods>;</methods></span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class android.util.Log {</span><br style="color: black;" /><span style="color: black;"> *** *(...);</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - System method calls. Remove all invocations of System</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.System {</span><br style="color: black;" /><span style="color: black;"> public static long currentTimeMillis();</span><br style="color: black;" /><span style="color: black;"> static java.lang.Class getCallerClass();</span><br style="color: black;" /><span style="color: black;"> public static int identityHashCode(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.SecurityManager getSecurityManager();</span><br style="color: black;" /><span style="color: black;"> public static java.util.Properties getProperties();</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String getProperty(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String getenv(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String mapLibraryName(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String getProperty(java.lang.String,java.lang.String);</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - Math method calls. Remove all invocations of Math</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.Math {</span><br style="color: black;" /><span style="color: black;"> public static double sin(double);</span><br style="color: black;" /><span style="color: black;"> public static double cos(double);</span><br style="color: black;" /><span style="color: black;"> public static double tan(double);</span><br style="color: black;" /><span style="color: black;"> public static double asin(double);</span><br style="color: black;" /><span style="color: black;"> public static double acos(double);</span><br style="color: black;" /><span style="color: black;"> public static double atan(double);</span><br style="color: black;" /><span style="color: black;"> public static double toRadians(double);</span><br style="color: black;" /><span style="color: black;"> public static double toDegrees(double);</span><br style="color: black;" /><span style="color: black;"> public static double exp(double);</span><br style="color: black;" /><span style="color: black;"> public static double log(double);</span><br style="color: black;" /><span style="color: black;"> public static double log10(double);</span><br style="color: black;" /><span style="color: black;"> public static double sqrt(double);</span><br style="color: black;" /><span style="color: black;"> public static double cbrt(double);</span><br style="color: black;" /><span style="color: black;"> public static double IEEEremainder(double,double);</span><br style="color: black;" /><span style="color: black;"> public static double ceil(double);</span><br style="color: black;" /><span style="color: black;"> public static double floor(double);</span><br style="color: black;" /><span style="color: black;"> public static double rint(double);</span><br style="color: black;" /><span style="color: black;"> public static double atan2(double,double);</span><br style="color: black;" /><span style="color: black;"> public static double pow(double,double);</span><br style="color: black;" /><span style="color: black;"> public static int round(float);</span><br style="color: black;" /><span style="color: black;"> public static long round(double);</span><br style="color: black;" /><span style="color: black;"> public static double random();</span><br style="color: black;" /><span style="color: black;"> public static int abs(int);</span><br style="color: black;" /><span style="color: black;"> public static long abs(long);</span><br style="color: black;" /><span style="color: black;"> public static float abs(float);</span><br style="color: black;" /><span style="color: black;"> public static double abs(double);</span><br style="color: black;" /><span style="color: black;"> public static int max(int,int);</span><br style="color: black;" /><span style="color: black;"> public static long max(long,long);</span><br style="color: black;" /><span style="color: black;"> public static float max(float,float);</span><br style="color: black;" /><span style="color: black;"> public static double max(double,double);</span><br style="color: black;" /><span style="color: black;"> public static int min(int,int);</span><br style="color: black;" /><span style="color: black;"> public static long min(long,long);</span><br style="color: black;" /><span style="color: black;"> public static float min(float,float);</span><br style="color: black;" /><span style="color: black;"> public static double min(double,double);</span><br style="color: black;" /><span style="color: black;"> public static double ulp(double);</span><br style="color: black;" /><span style="color: black;"> public static float ulp(float);</span><br style="color: black;" /><span style="color: black;"> public static double signum(double);</span><br style="color: black;" /><span style="color: black;"> public static float signum(float);</span><br style="color: black;" /><span style="color: black;"> public static double sinh(double);</span><br style="color: black;" /><span style="color: black;"> public static double cosh(double);</span><br style="color: black;" /><span style="color: black;"> public static double tanh(double);</span><br style="color: black;" /><span style="color: black;"> public static double hypot(double,double);</span><br style="color: black;" /><span style="color: black;"> public static double expm1(double);</span><br style="color: black;" /><span style="color: black;"> public static double log1p(double);</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - Number method calls. Remove all invocations of Number</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.* extends java.lang.Number {</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(byte);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Byte valueOf(byte);</span><br style="color: black;" /><span style="color: black;"> public static byte parseByte(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static byte parseByte(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Byte valueOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Byte valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Byte decode(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Byte);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(short);</span><br style="color: black;" /><span style="color: black;"> public static short parseShort(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static short parseShort(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Short valueOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Short valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Short valueOf(short);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Short decode(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static short reverseBytes(short);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Short);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(int,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toHexString(int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toOctalString(int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toBinaryString(int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(int);</span><br style="color: black;" /><span style="color: black;"> public static int parseInt(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static int parseInt(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer valueOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer valueOf(int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer getInteger(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer getInteger(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer getInteger(java.lang.String,java.lang.Integer);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Integer decode(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static int highestOneBit(int);</span><br style="color: black;" /><span style="color: black;"> public static int lowestOneBit(int);</span><br style="color: black;" /><span style="color: black;"> public static int numberOfLeadingZeros(int);</span><br style="color: black;" /><span style="color: black;"> public static int numberOfTrailingZeros(int);</span><br style="color: black;" /><span style="color: black;"> public static int bitCount(int);</span><br style="color: black;" /><span style="color: black;"> public static int rotateLeft(int,int);</span><br style="color: black;" /><span style="color: black;"> public static int rotateRight(int,int);</span><br style="color: black;" /><span style="color: black;"> public static int reverse(int);</span><br style="color: black;" /><span style="color: black;"> public static int signum(int);</span><br style="color: black;" /><span style="color: black;"> public static int reverseBytes(int);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Integer);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(long,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toHexString(long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toOctalString(long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toBinaryString(long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(long);</span><br style="color: black;" /><span style="color: black;"> public static long parseLong(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static long parseLong(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long valueOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long valueOf(long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long decode(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long getLong(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long getLong(java.lang.String,long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Long getLong(java.lang.String,java.lang.Long);</span><br style="color: black;" /><span style="color: black;"> public static long highestOneBit(long);</span><br style="color: black;" /><span style="color: black;"> public static long lowestOneBit(long);</span><br style="color: black;" /><span style="color: black;"> public static int numberOfLeadingZeros(long);</span><br style="color: black;" /><span style="color: black;"> public static int numberOfTrailingZeros(long);</span><br style="color: black;" /><span style="color: black;"> public static int bitCount(long);</span><br style="color: black;" /><span style="color: black;"> public static long rotateLeft(long,int);</span><br style="color: black;" /><span style="color: black;"> public static long rotateRight(long,int);</span><br style="color: black;" /><span style="color: black;"> public static long reverse(long);</span><br style="color: black;" /><span style="color: black;"> public static int signum(long);</span><br style="color: black;" /><span style="color: black;"> public static long reverseBytes(long);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Long);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(float);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toHexString(float);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Float valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Float valueOf(float);</span><br style="color: black;" /><span style="color: black;"> public static float parseFloat(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static boolean isNaN(float);</span><br style="color: black;" /><span style="color: black;"> public static boolean isInfinite(float);</span><br style="color: black;" /><span style="color: black;"> public static int floatToIntBits(float);</span><br style="color: black;" /><span style="color: black;"> public static int floatToRawIntBits(float);</span><br style="color: black;" /><span style="color: black;"> public static float intBitsToFloat(int);</span><br style="color: black;" /><span style="color: black;"> public static int compare(float,float);</span><br style="color: black;" /><span style="color: black;"> public boolean isNaN();</span><br style="color: black;" /><span style="color: black;"> public boolean isInfinite();</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Float);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toString(double);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String toHexString(double);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Double valueOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.Double valueOf(double);</span><br style="color: black;" /><span style="color: black;"> public static double parseDouble(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public static boolean isNaN(double);</span><br style="color: black;" /><span style="color: black;"> public static boolean isInfinite(double);</span><br style="color: black;" /><span style="color: black;"> public static long doubleToLongBits(double);</span><br style="color: black;" /><span style="color: black;"> public static long doubleToRawLongBits(double);</span><br style="color: black;" /><span style="color: black;"> public static double longBitsToDouble(long);</span><br style="color: black;" /><span style="color: black;"> public static int compare(double,double);</span><br style="color: black;" /><span style="color: black;"> public boolean isNaN();</span><br style="color: black;" /><span style="color: black;"> public boolean isInfinite();</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Double);</span><br style="color: black;" /><span style="color: black;"> public <init>(byte);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(short);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(long);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(float);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(double);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public byte byteValue();</span><br style="color: black;" /><span style="color: black;"> public short shortValue();</span><br style="color: black;" /><span style="color: black;"> public int intValue();</span><br style="color: black;" /><span style="color: black;"> public long longValue();</span><br style="color: black;" /><span style="color: black;"> public float floatValue();</span><br style="color: black;" /><span style="color: black;"> public double doubleValue();</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public boolean equals(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public int hashCode();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toString();</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - String method calls. Remove all invocations of String</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.String {</span><br style="color: black;" /><span style="color: black;"> public <init>();</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[]);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[],int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[],int,int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[],int,int,int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[],int,int,java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(byte[],java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(char[]);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(char[],int,int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.StringBuffer);</init></span><br style="color: black;" /><span style="color: black;"> public static java.lang.String copyValueOf(char[]);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String copyValueOf(char[],int,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(boolean);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(char);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(char[]);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(char[],int,int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(double);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(float);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(int);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public static java.lang.String valueOf(long);</span><br style="color: black;" /><span style="color: black;"> public boolean contentEquals(java.lang.StringBuffer);</span><br style="color: black;" /><span style="color: black;"> public boolean endsWith(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public boolean equalsIgnoreCase(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public boolean equals(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public boolean matches(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public boolean regionMatches(boolean,int,java.lang.String,int,int);</span><br style="color: black;" /><span style="color: black;"> public boolean regionMatches(int,java.lang.String,int,int);</span><br style="color: black;" /><span style="color: black;"> public boolean startsWith(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public boolean startsWith(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public byte[] getBytes();</span><br style="color: black;" /><span style="color: black;"> public byte[] getBytes(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public char charAt(int);</span><br style="color: black;" /><span style="color: black;"> public char[] toCharArray();</span><br style="color: black;" /><span style="color: black;"> public int compareToIgnoreCase(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.Object);</span><br style="color: black;" /><span style="color: black;"> public int compareTo(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int hashCode();</span><br style="color: black;" /><span style="color: black;"> public int indexOf(int);</span><br style="color: black;" /><span style="color: black;"> public int indexOf(int,int);</span><br style="color: black;" /><span style="color: black;"> public int indexOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int indexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(int);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(int,int);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int length();</span><br style="color: black;" /><span style="color: black;"> public java.lang.CharSequence subSequence(int,int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String concat(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String replaceAll(java.lang.String,java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String replace(char,char);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String replaceFirst(java.lang.String,java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String[] split(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String[] split(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int,int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toLowerCase();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toLowerCase(java.util.Locale);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toString();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toUpperCase();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String toUpperCase(java.util.Locale);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String trim();</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - StringBuffer method calls. Remove all invocations of StringBuffer</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.StringBuffer {</span><br style="color: black;" /><span style="color: black;"> public <init>();</init></span><br style="color: black;" /><span style="color: black;"> public <init>(int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.CharSequence);</init></span><br style="color: black;" /><span style="color: black;"> public java.lang.String toString();</span><br style="color: black;" /><span style="color: black;"> public char charAt(int);</span><br style="color: black;" /><span style="color: black;"> public int capacity();</span><br style="color: black;" /><span style="color: black;"> public int codePointAt(int);</span><br style="color: black;" /><span style="color: black;"> public int codePointBefore(int);</span><br style="color: black;" /><span style="color: black;"> public int indexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int length();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int,int);</span><br style="color: black;" /><span style="color: black;">}</span><br style="color: black;" /><br style="color: black;" /><span style="color: black;"># Remove - StringBuilder method calls. Remove all invocations of StringBuilder</span><br style="color: black;" /><span style="color: black;"># methods without side effects whose return values are not used.</span><br style="color: black;" /><span style="color: black;">-assumenosideeffects public class java.lang.StringBuilder {</span><br style="color: black;" /><span style="color: black;"> public <init>();</init></span><br style="color: black;" /><span style="color: black;"> public <init>(int);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.String);</init></span><br style="color: black;" /><span style="color: black;"> public <init>(java.lang.CharSequence);</init></span><br style="color: black;" /><span style="color: black;"> public java.lang.String toString();</span><br style="color: black;" /><span style="color: black;"> public char charAt(int);</span><br style="color: black;" /><span style="color: black;"> public int capacity();</span><br style="color: black;" /><span style="color: black;"> public int codePointAt(int);</span><br style="color: black;" /><span style="color: black;"> public int codePointBefore(int);</span><br style="color: black;" /><span style="color: black;"> public int indexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String);</span><br style="color: black;" /><span style="color: black;"> public int lastIndexOf(java.lang.String,int);</span><br style="color: black;" /><span style="color: black;"> public int length();</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int);</span><br style="color: black;" /><span style="color: black;"> public java.lang.String substring(int,int);</span><br style="color: black;" /><span style="color: black;">}</span></i></span></span><br />
<br />
BR,<br />
<br />
LulaUnknownnoreply@blogger.com2tag:blogger.com,1999:blog-1072233363145751245.post-64758850853800335102011-04-26T16:37:00.000-04:002011-04-26T16:37:25.177-04:00How to check if an APK has the flag android:debuggable="true"Using the aapt tool you can check lots of things inside an apk. Use the following command:<br />
<br />
<i>aapt list -v -a myfile.apk</i><br />
<br />
this shows hundreds of lines, but you must search the following text "android:debuggable"<br />
<br />
this flag can have the values:<br />
<br />
<b>0x0</b>: debuggable false<br />
<b>0xffffffff</b>: debugabble true<br />
<br />
in my case the entire line is the following<br />
<br />
<b>A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff</b><br />
<br />
Ups! My release build had the flag enabled ;) <br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-1072233363145751245.post-34152678391516679482010-03-02T18:29:00.000-05:002010-03-02T18:29:46.974-05:00Proguard 4.x error - java.lang.ArrayIndexOutOfBoundsException - How to fix itUsing Proguard to obfuscate your classes in your midlets is a must. The jar size is reduced and the code is optimized.<br />
<br />
But when I obfuscated my app an error is displayed and the jar is not obfustaced. The error is similar to:<br />
<br />
java.lang.ArrayIndexOutOfBoundsException: 2<br />
<br />
WTF is this? :)<br />
<br />
I don't know why, I didn't download the source of proguard (BTW this amazing tool is opensource)<br />
<br />
How to fix it? Two options:<br />
* disable optimization. It's not the best option but it helps. Use parameter -dontoptimize<br />
* disable optimization partially. I used this option. The last proguard has many parameters for optimization, and I found the parameter that worked in my midlet:<br />
<br />
-optimizations !method/marking/static<br />
<br />
this means the optimizer will avoid marking methods as static.<br />
<br />
It worked for me, I hope it works for you.<br />
<br />
Proguard optimizations site: http://proguard.sourceforge.net/manual/optimizations.htmlUnknownnoreply@blogger.com3tag:blogger.com,1999:blog-1072233363145751245.post-61731527712383655612010-03-02T18:17:00.001-05:002010-03-06T15:18:01.775-05:00Samsung - Java Error: Invalid Format. How to fix it.There is a strange error in Samsung phones. When you try to launch a midlet the phone displays the message "Java Error: Invalid format".<br />
<br />
Why?<br />
<br />
This means the virtual machine can't load the classes of the midlet. It could be:<br />
- the classes are not preverified<br />
- the classes are corrupted<br />
- the classes are ok but the VM can't load them, because an exception is launched while they are loading..<br />
<br />
We will focus in the last option. <b>Why a class can't be loaded and how to fix it?</b><br />
<br />
- Sometimes we write some lines of code in the midlet constructor. But this lines can have method calls to other classes and so on, and all classes must be loaded BEFORE the midlet is initializad. If the midlet is not initialized it can't manage well things like screen.getWidth and getHeight, etc. <b>Avoid method calls in the midlet constructor.</b><br />
- <b>Other cause can be to write method calls in static blocks or static variables</b>. It's the same problem than before, lots of things must be loaded BEFORE the midlet is instantiated.<br />
<br />
So, now the midlet is instantiated before the classes are loaded. Now the error "Invalid Formatd" shouldn't appear. Your phone must launch now an exception or anything similar.<br />
<br />
E.g: Samsung S8000 Jet. This phone has a problem in some firmwares. The method Font.getSize() returns a non standard value, and when you want to obtain a new font using the size returned by Font.getSize() an exception is launched. If this code is called by the constructor block an exception is thrown before the midlet is instantiated, so the error "Invalid Format" is displayed.<br />
<br />
I worked with lots of samsungs and generally the solution is the same. Avoid coding in the constructor to find easily the errors.<br />
<br />
I hope it works for you.<br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com19tag:blogger.com,1999:blog-1072233363145751245.post-28618637846881131872010-02-27T00:27:00.002-05:002010-03-02T18:21:59.039-05:00Bug Sony W580: error displaying text using UTF8 encodingThere is a strange bug with SonyEricsson W580. When drawing strings in UTF8 format some special characters are not displayed.<br />
The strings are created using the following:<br />
<br />
<div style="color: blue;">new String(bytearray, offset, size, "UTF-8")</div><br />
and to fix the bug it must be created using:<br />
<br />
<span style="color: blue;"> StringBuffer sb = new StringBuffer();</span><br />
<span style="color: blue;"> for (int i = offset; i < offset + size; i++) {</span><br />
<span style="color: blue;"> sb.append(new String(bytearray, i, bytearray[i] < 0 ? 2 : 1, "UTF-8"));</span><br />
<span style="color: blue;"> if (bytearray[i] < 0){ i++; }</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> String txt = sb.toString();</span><br />
<br />
A tiny bug, and a very ugly fix ;)<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-39024654214106191102009-12-10T21:41:00.000-05:002009-12-10T21:41:31.632-05:00Java Class unpacker v0.7.1 releasedJava Class Unpacker v0.7.1 released.<br />
Plugin for Total Commander<br />
<br />
Changes:<br />
* fixed LDC_W opcode<br />
* fixed MULTIANEWARRAY opcode<br />
* fixed GOTO_W opcode<br />
* fixed NEWARRAY opcode<br />
- refactoring<br />
- implemented basic configuration<br />
- fixed char type in constant pool<br />
<br />
Download: <a href="http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker">http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker</a><br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com2tag:blogger.com,1999:blog-1072233363145751245.post-35250005443788338072009-12-01T09:42:00.000-05:002009-12-01T09:42:24.594-05:00Java Class Unpacker v0.7.0Java Class Unpacker v0.7.0 released.<br />
Plugin for Total Commander<br />
<br />
Changes:<br />
- fixed NEW opcode<br />
- fixed error with classes containing many attribute types: SourceFile, ConstantValue, Exceptions, InnerClasses, Synthetic, LineNumberTable, LocalVariableTable, Deprecated,<br />
- fixed native methods<br />
+ added header.txt in class unpack containing class header info<br />
- fixed locals and stack size in method unpack<br />
- fixed integer, long, float and double in constant pool<br />
<br />
Download: <a href="http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker">http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker</a><br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-31396492354377409202009-11-27T22:24:00.001-05:002009-11-27T22:25:22.881-05:00Java Class Unpacker v0.6.0Java Class Unpacker v0.6.0 released.<br />
Plugin for Total Commander<br />
<br />
Changes:<br />
- fixed: abstract classes and methods<br />
- added constant pool<br />
- implemented decompilation of tableswitch and lookupswitch<br />
- file offsets and hexa bytes in code<br />
- renamed file to JavaClassUnpacker.wcx<br />
<br />
Download: <a href="http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker">http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker</a><br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-3988916433698297442009-11-26T23:53:00.000-05:002009-11-26T23:53:09.750-05:00New Total Commander Plugin - Java Class Unpacker v0.5.0I developed a new plugin for the amazing Total Commander. Using this plugin you can enter to class files as compressed files and see fields and methods as files.<br />
Methods can be viewed using F3, the java bytecode is displayed as text.<br />
<br />
I have no site so I uploaded to megaupload, you can download it from:<br />
<br />
<a href="http://www.megaupload.com/?d=8BW30ZAD">http://www.megaupload.com/?d=8BW30ZAD</a><br />
<br />
Please feel free to send me bugs, comments or suggestions.<br />
<br />
Enjoy!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-83871577494633222162009-11-13T09:34:00.000-05:002009-11-13T09:34:10.832-05:00J2ME: Fixing Cannot find class java/lang/NoClassDefFoundError at preverifyI had a strange error when preverifying a midlet.<br />
<br />
[exec] Error preverifying class temp.TestMidlet<br />
[exec] VERIFIER ERROR temp/TestMidlet.<clinit>()V:<br />
[exec] Cannot find class java/lang/NoClassDefFoundError</clinit><br />
<br />
The midlet is ok, Eclipse doesn't display an error. Searching in all the library jars in WTK I found the class NoClassDefFoundError is inside cldcapi11.jar. I modified the cldc jar and nows compiles.<br />
<br />
But is not enough for me, I'm not using float or doubles so I want to compile the midlet for CLDC10. So I continued playing and I found the reason: I'm using the field named "class" to obtain the name of a class.<br />
<br />
E.g:<br />
<br />
To obtain the Class object of class TestMidlet I'm using the following code:<br />
<br />
Class clazz = TestMidlet.class;<br />
<br />
this is ok for CLDC11 but for CLDC10 is wrong, I must use this.getClass or something similar.<br />
<br />
I hope you can find this useful.<br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-11240595981163440882009-11-13T07:47:00.001-05:002009-11-13T07:48:49.918-05:00All mobile developer sitesJust for reference, I'm writing here all developer sites useful for mobile frikis:<br />
<br />
<b>Java Mobile</b><br />
<a href="http://developers.sun.com/mobility">http://developers.sun.com/mobility</a><br />
<br />
<b>Sony</b><br />
<a href="http://developer.sonyericsson.com/">http://developer.sonyericsson.com</a><br />
<br />
<b>Motorola</b><br />
<a href="http://developer.motorola.com/">http://developer.motorola.com</a><br />
<br />
<b>Nokia</b><br />
<a href="http://www.nokia.com/developers">http://www.nokia.com/developers</a><br />
<br />
<b>Samsung</b><br />
<a href="http://innovator.samsungmobile.com/">http://innovator.samsungmobile.com</a><br />
<br />
<b>IPhone</b><br />
<a href="http://developer.apple.com/iphone">http://developer.apple.com/iphone</a><br />
<br />
<b>Android</b><br />
<a href="http://developer.android.com/">http://developer.android.com</a><br />
<br />
<b>Blackberry</b><br />
<a href="http://na.blackberry.com/eng/developers">http://na.blackberry.com/eng/developers</a><br />
<br />
<b>BREW</b><br />
<a href="http://brew.qualcomm.com/brew/en/developer/overview.html">http://brew.qualcomm.com/brew/en/developer/overview.html</a><br />
<br />
<b>HTC</b><br />
<a href="http://developer.htc.com/">http://developer.htc.com</a><br />
<br />
<b>Windows Mobile</b><br />
<a href="http://developer.windowsmobile.com/">http://developer.windowsmobile.com</a><br />
<a href="http://msdn.microsoft.com/en-us/windowsmobile/default.aspx">http://msdn.microsoft.com/en-us/windowsmobile/default.aspx</a><br />
<br />
<b>OpenGL ES</b><br />
<a href="http://www.khronos.org/opengles">http://www.khronos.org/opengles</a><br />
<br />
Let's go mobile!<br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1072233363145751245.post-75121675633897554352009-11-10T10:28:00.000-05:002009-11-10T10:28:05.398-05:00Convert Android DEX to JavaI'm playing with a great Android to Java converter named UnDX. You can find it at<br />
<br />
<a href="http://www.illegalaccess.org/undx">http://www.illegalaccess.org/undx</a><br />
<br />
it uses BCEL to convert the files. It's in beta, has some errors.<br />
<br />
So, I decided to create my own converter using ASM. The idea is simple:<br />
<br />
- Create a DEX reader extending ClassReader. Here call all the Visitor events to generate the java code.<br />
- Use ASM to manipulate the java bytecode.<br />
- Create a DEX ClassWriter. It must be exactly the same for java, but after generating all the bytearrays it must use dx command to create de DEX file.<br />
<br />
The idea is simple, I had some tests and it works! I'm generating the java code and I can manipulate it.<br />
<br />
I'll tell you later what happens with some big DEX files.<br />
<br />
Cheers,<br />
<br />
LulaUnknownnoreply@blogger.com2