tag:blogger.com,1999:blog-88192842828945482812024-03-19T10:18:35.892+01:00Bartosz Kosarzycki's blogBartosz Kosarzycki's blog - developers' issues being solvedBartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.comBlogger268125tag:blogger.com,1999:blog-8819284282894548281.post-74462689595743515702016-04-12T10:21:00.001+02:002016-04-12T10:25:06.851+02:00Kotlin during Android Developer Group Poznań (ADG) meetup<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Last week I presented STX Insider project at Android Developer Group meetup in Poznań, Poland (ADG). It’s entirely written in JetBrains’ new programming language Kotlin. The presentation was focused on technical aspects of the code, mainly on nullpointer safety, interoperability with Java, final value preference, nullable types and extension functions. After the talk, participants had the chance to answer a few questions about the language.<br />
<br />
One can draw the following conclusions from the survey:<br />
<ul>
<li>developers are intersted in Kotlin but most of them haven’t written anything in it yet</li>
<li>they see the potential but aren’t ready to abandon Java just yet</li>
</ul>
<br />
Event details (ADG Poznań):<br />
<a href="https://www.facebook.com/PoznanADG/posts/1458635877496012">https://www.facebook.com/PoznanADG/posts/1458635877496012</a><br />
<br />
Presentation slides:<br />
<a href="http://www.slideshare.net/BartoszKosarzycki/adg-pozna-kotlin-for-android-developers">http://www.slideshare.net/BartoszKosarzycki/adg-pozna-kotlin-for-android-developers</a><br />
<br />
<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/kotlin_poll.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/kotlin_poll.png" height="320" width="192" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com494tag:blogger.com,1999:blog-8819284282894548281.post-66750906435874165572016-04-07T14:50:00.001+02:002016-04-07T14:50:19.390+02:00Kotlin advanced - language reference for android developers<b><br /></b>
<b>Kotlin</b> - one of the popular programming languages built on top of Java that runs on JVM.<br />
<br />As a <b>mobile</b> team we got interested in Kotlin a few months before its final release which gave us time to test it thoroughly before production use. The language has some clear advantages for an <b>Android</b> programmer - it enables migration from Java projects that have been under development for some time already. Java&Kotlin <b>coexistence</b> simplifies Kotlin introduction as only new functionality is written in JetBrain’s new language leaving all the legacy code untouched. <br /><br />Transitioning gives the developer an opportunity to use lambdas, new syntax for data objects, extension functions to easily expand Android SDK’s classes functionality and infix notation to write DSL-like structures. Almost all the libraries you use today will work with Kotlin thanks to 100% Java compatibility. The same is true for Android SDK classes - all of them will seamlessly work with the new programming language. Kotlin gives you more choice when it comes to reflection, creating documentation and being null-pointer safe. Android works great with it out of the box so you won’t need to change your development habits.<br /><br />Our production project in Kotlin turned out to be a success after 4 months of development. We had <b>0 bugs related to Kotlin as a programming language</b>. Our code footprint is almost <b>30% smaller </b>thanks to JetBrain’s, we benefit from nullpointer safety, closures, translated enums, data objects and use infix notation for logging and displaying Snackbars. <div>
<br /><b>Kotlin advanced - language reference for android developers</b><br /><br />Second talk on Kotlin language we had at STXNext. We try go deeper into language specifics and look at the positive impact new syntax can have on boilerplate removal and readability improvement. Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well. <div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #fefefe; color: #212121; font-family: Arial; font-size: 14px; line-height: 1.38; white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.slideshare.net/BartoszKosarzycki/kotlin-advanced-language-reference-for-android-developers" target="_blank"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/Screen%20Shot%202016-04-07%20at%202.41.33%20PM.png" height="184" width="320" /></a><span id="goog_493720221"></span><span id="goog_493720222"></span><a href="https://www.blogger.com/"></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
</div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com19tag:blogger.com,1999:blog-8819284282894548281.post-90315597070464605372016-03-21T17:34:00.001+01:002016-03-21T17:34:27.564+01:00Zulip IM<br />
Lately we've moved to <b>Zulip</b> as our main company <b>IM</b> <b>app</b>.<br />
The story behind Zulip is that it was created as group chat application optimized for software development teams and later on (around 2014) acquired by <b>Dropbox</b>. The development of the core application ceased due to harsh competition from <b>Slack</b>. On <b>Sept 25, 2015</b> the original Zulip team decided to <b>open-source</b> the project and make it publicly available.<br />
Zulip has some clear advantages over the pure <b>internal jabber server</b>, the main of which is the web client access and no configuration to hassle with (other features are listed here - <a href="https://zulip.org/features.html">https://zulip.org/features.html</a>)<br />
<br />
Zulip's <b>Android app</b> has not been updated since Feb, 2015 and probably will never be so we took the code and refreshed it. On the plus side - <b>it works with our internal IM server</b>, the design has been slightly refreshed (although almost no material design is present there).<br />
With the current version push-notifications are switched off so there is no battery drain and the IM doesn't bother you until you open the app to have a chat.<br />
In future versions push notifications will be present ONLY as an option.<br />
<br />
You can <b>download</b> the app here:<br />
<a href="https://goo.gl/u8QU1x">https://goo.gl/u8QU1x</a><br />
<br />
The source code is available here:<br />
<a href="https://github.com/kosiara/zulip-android">https://github.com/kosiara/zulip-android</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/zulip_stx_android_app.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/zulip_stx_android_app.png" height="320" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com12tag:blogger.com,1999:blog-8819284282894548281.post-61729709958426563642016-02-16T11:13:00.001+01:002016-02-16T11:13:09.939+01:00Kotlin Developer Starter in Android projects<br />
During our STX Next's <b>Lightning Talks</b> I'd given a presentation about <b>Kotlin</b>. It's a quick starter about the language. The idea was to create a short talk that would fit in a timeframe of 45m-1h. I assumed that attendees had basic skills from Android development, functional programming, java JDK and some JVM languages like - scala, closure or groovy.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/Kotlin_slideshare.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/Kotlin_slideshare.png" height="234" width="320" /></a></div>
<br />
<br />
Slideshare presentation:<br />
<a href="https://t.co/oVPJw1YIGa">https://t.co/oVPJw1YIGa</a><br />
<br />
<br />
Presentation summary:<br />
<i>Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and keeping short compile times on the other.</i><br />
<i><br /></i>
<i>This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up a kotlin-based Android project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.</i><br />
<i><br /></i>
<i><br /></i>Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com27tag:blogger.com,1999:blog-8819284282894548281.post-33047201428229253792015-12-08T13:24:00.004+01:002015-12-08T13:28:49.356+01:00Automated acceptance tests in CalabashThe <b>Mobilengers team at StxNext </b>has recently moved to <b>Calabash</b> as our automated acceptance testing framework. All tests are written in <b>Gherkin</b> - simple, descriptive language that <b>Cucumber</b> can understand. <i>Gherkin</i> gives the ability to describe the desired behaviour in plain text preserving the possibility to run such a test on real devices. It serves two purposes - as a documentation tool and as automated tests framework. It has been translated to over 60 spoken languages (with leading English) so that your team can use the keywords in their own language. <br /><br />Automated tests follow two simple conventions - that source file should be saved as <i>.feature</i> and that one source file should only contain description of a single feature.<br /><br /><i>Calabash</i> is the mobile implementation of <i>Cucumber</i>. It enables native apps testing and is cross-platform - <b>Android/iOS</b>. It’s also open-source with all the code available freely on <b>GitHub</b>.<br /><br />With <i>Calabash</i> we’re able to implement simple gestures (like - swipe down, button-clicks, go back etc.), make assertions concerning displayed content as well as take screenshots whenever something goes wrong in the app.<br /><br />Running tests in the cloud on the real devices gives us the possibility to cover more devices without buying every phone available on the market. We use <b>Amazon AWS Device Farm </b>which has the possibility to run <i>Calabash</i> tests and covers most popular device models. It also gives detailed tests results, takes screenshots as well as pinpoints references to lines of source code where specific errors have originated from. AWS has the option to test apps in different device locales, GPS locations and specific “other apps” dependencies. <br /><br />Simple tutorial on how to install Calabash <i>(OsX/Ubuntu)</i> and run basic tests can be downloaded <a href="https://github.com/kosiara/calabash-android-example-projects">here</a>.<b id="docs-internal-guid-6b6004a7-8187-9323-f581-a11e8ab26ec6" style="font-weight: normal;"><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/Li8fQNupXfs/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/Li8fQNupXfs?feature=player_embedded" width="320"></iframe></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<b style="font-weight: normal;"><br /></b>
<br />
Reference:<br /><a href="https://github.com/kosiara/calabash-android-example-projects">https://github.com/kosiara/calabash-android-example-projects</a><br /><a href="https://github.com/calabash/calabash-android">https://github.com/calabash/calabash-android</a><br /><a href="https://github.com/calabash/calabash-ios">https://github.com/calabash/calabash-ios</a><br /><a href="https://cucumber.io/">https://cucumber.io/</a><br /><a href="https://github.com/cucumber/cucumber/wiki/Gherkin">https://github.com/cucumber/cucumber/wiki/Gherkin</a><br /><a href="http://www.slideshare.net/Codemotion/calabash-codemotion-2012">http://www.slideshare.net/Codemotion/calabash-codemotion-2012</a> (ios)<br /><a href="http://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html">http://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html</a><br /><br />Books:<br /><a href="https://pragprog.com/book/hwcuc/the-cucumber-book">https://pragprog.com/book/hwcuc/the-cucumber-book</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/1_intranet_tests.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/1_intranet_tests.png" height="180" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/2_intranet_tests.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/2_intranet_tests.png" height="180" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/3_Cucumber.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/3_Cucumber.png" height="179" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/4_aws.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/4_aws.png" height="180" width="320" /></a></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: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/5_aws.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/5_aws.png" height="181" width="320" /></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/6_aws.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/6_aws.png" height="182" width="320" /></a></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: center;">
<a href="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/7_aws.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://b6989da3-a-62cb3a1a-s-sites.googlegroups.com/site/bkosarzyckistorage3/7_aws.jpg" height="320" width="266" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com10tag:blogger.com,1999:blog-8819284282894548281.post-75943697292165281122015-05-10T17:57:00.002+02:002015-05-10T17:58:16.216+02:00PEKA - wirtualny monitor<div>
Niedawno rozpoczęły się prace nad aplikacją umożliwiającą sprawdzanie dokładnego czasu przyjazdu tramwajów i autobusów.</div>
<div>
Nareszcie możliwe jest wygodne korzystanie z wirtualnego monitora systemu PEKA na urządzeniach mobilnych.</div>
<div>
<br /></div>
<div>
Jeżeli mieszkasz w Poznaniu - wybierz ulicę, a następnie swój przystanek - aby zobaczyć dane, które pozwolą Ci DOKŁADNIE określić w którym momencie przyjedzie Twój tramwaj/autobus.</div>
<div>
<br /></div>
<div>
Funkcje: </div>
<div>
- szukaj połączeń autobusowych/tramwajowych według ulicy/nazwy przystanku/nr linii </div>
<div>
- dodawaj poszczególne przystanki do ulubionych, aby mieć do nich szybki dostęp </div>
<div>
- połączenia z rzeczywistym czasem przyjazdu są oznaczone niebieskim "GPS"</div>
<div>
- widget umożliwiający obserwowanie swojego ulubionego przystanku</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Kliknij <a href="http://play.google.com/store/apps/details?id=com.bkosarzycki.pekawirtualnymonitor" target="_blank">tutaj</a>, aby przejść do Google Play.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/jvAE2uJhcruxMgY6c7g_9WJiqhD99pvuTmXZvkrjxjKUM1Bt6IWjttSPjMxkyzFviT0=h900-rw" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://1.bp.blogspot.com/jvAE2uJhcruxMgY6c7g_9WJiqhD99pvuTmXZvkrjxjKUM1Bt6IWjttSPjMxkyzFviT0=h900-rw" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/2RKJyKRgWvPfEfKWw2gVeVT5pnlYieeoHsIpb636PSsTS4Fbh1EfN1Ld2U-ics6DAG8=h900-rw" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://1.bp.blogspot.com/2RKJyKRgWvPfEfKWw2gVeVT5pnlYieeoHsIpb636PSsTS4Fbh1EfN1Ld2U-ics6DAG8=h900-rw" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://goo.gl/7rIwmg" target="_blank"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/7/77/Android-app-on-google-play.svg" height="65" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<div>
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com4tag:blogger.com,1999:blog-8819284282894548281.post-7732011113492954282015-04-04T18:40:00.000+02:002015-04-04T18:40:00.853+02:00OsX - handful of shortcut key combinations1. q: Where is the insert key a: Apple's keyboard does not have an insert key<br /> emulate 'ins' key by pressing Ctrl + "t"<br />
<br />
2. q: Where is the ~ key? a: to the right of the left "shift" key<br />
<br />
3. q: How to take a screenshot of the screen? a: press "ctrl" + 3 - to take the screenshot of the entire screen and "ctrl" + 4 - to take the screenshot of the selected screen area. Screenshots are saved on the desktop<br />
<br />
<br />
<br />
Resources:<br />
<a href="http://luisjdominguezp.tumblr.com/post/36357730931/mac-os-x-and-midnight-commander-the-missing">mac-os-x-and-midnight-commander-the-missing</a><br />
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com8tag:blogger.com,1999:blog-8819284282894548281.post-2947034474267031872015-03-29T17:52:00.003+02:002015-03-29T17:52:57.897+02:00OsX - default partition tableWhat is the default partition type on <b>OsX 10.10 Yosemite</b>?<br />
<br />
Partition table: GUID partition table (<b>gpt</b>)<br />
partition type: <b>hfs+</b><br />
<b><br /></b>
<b><br /></b>Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com0tag:blogger.com,1999:blog-8819284282894548281.post-4566321544999389642015-03-18T22:01:00.000+01:002015-03-18T22:01:17.672+01:00OsX - choose the right Java version for Intellij 14 CE<br />
<div class="p1">
<span class="s1">/Applications/IntelliJ IDEA 14 CE.app/Contents/bin/inspect.sh</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">2015-03-18 21:02:24.425 idea[962:382297] <b>No matching VM found.</b></span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">[JavaAppLauncher Error] CFBundleCopyResourceURL() failed while getting Resource/Java directory</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">[LaunchRunner Error] No main class specified</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">Exception in thread "main" java.lang.NullPointerException</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span"> </span>at apple.launcher.LaunchRunner.run(LaunchRunner.java:113)</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span"> </span>at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">
</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span"> </span>at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">Download the newest "Apple Java" from <a href="https://support.apple.com/kb/DL1572?locale=en_US" target="_blank">here</a>.</span></div>
<div class="p1">
<span class="s1">Download the regular Oracle Java.</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
Remember to set the JAVA_HOME variable in .bash_profile correctly:<br />
export JAVA_HOME= <b>/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home</b><br />
<br />
You can also edit the file: /Applications/IntelliJ IDEA 14 CE.app/Contents/<b>Info.plist</b><br />
<span class="s1"></span><br />
and change 1.6 to <b>1.8</b><br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1tag:blogger.com,1999:blog-8819284282894548281.post-3205625558023648182015-03-06T17:36:00.004+01:002015-03-06T17:36:47.234+01:00Android - List all activities from *.apk file<span style="color: #3d85c6;"><br /></span>
<b><span style="color: #3d85c6; font-family: Courier New, Courier, monospace;">aapt dump xmltree <apk-file> AndroidManifest.xml</span></b><br />
<span style="color: #3d85c6;"><br /></span>
<span style="color: #3d85c6;"><br /></span>
<span style="color: #3d85c6;"><br /></span>
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1tag:blogger.com,1999:blog-8819284282894548281.post-67684682122543156232015-02-27T10:34:00.002+01:002015-02-27T10:35:19.044+01:00Ubuntu 14.04 LTS Chrome - enable touch mode (Android-like support)1. Check you Chrome flags configuration - go to chrome://flags<br />
<br />
<span class="experiment-name" jscontent="name" jstcache="9" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px; font-weight: bold;">Enable touch events</span><span style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"> </span><span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;">Mac, Windows, Linux, Chrome OS</span><br />
<span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"><span class="experiment-name" jscontent="name" jstcache="9" style="font-weight: bold;">Enable pinch scale.</span> <span jscontent="supported_platforms.join(', ')" jstcache="10">Windows, Linux, Chrome OS</span></span><br />
<span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"><span jscontent="supported_platforms.join(', ')" jstcache="10"><span class="experiment-name" jscontent="name" jstcache="9" style="font-weight: bold;">Enable pinch virtual viewport.</span> <span jscontent="supported_platforms.join(', ')" jstcache="10">Windows, Linux, Chrome OS, Android</span></span></span><br />
<span class="experiment-name" jscontent="name" jstcache="9" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px; font-weight: bold;">Enable touch based text editing</span><span style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"> </span><span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;">Windows, Linux, Chrome OS</span><br />
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"><br /></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"><span style="font-family: 'Times New Roman'; font-size: small;">2. Check the no. of your touch-panel</span></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10" style="font-family: Ubuntu, Arial, sans-serif; font-size: 10.5600004196167px;"><span style="font-family: 'Times New Roman'; font-size: small;"><br /></span></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10">xinput list</span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><br /></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10">for me it gave:</span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><br /></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10">Atmel Atmel maXTouch Digitizer <span class="Apple-tab-span" style="white-space: pre;"> </span>id=10<span class="Apple-tab-span" style="white-space: pre;"> </span>[slave pointer (2)]</span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><br /></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10">3. Start your chrome browser with the following script</span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><br /></span></div>
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><span style="font-family: Courier New, Courier, monospace;"></span></span><br />
<div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #674ea7;"><b>#!/bin/bash</b></span></span></span></div>
<span jscontent="supported_platforms.join(', ')" jstcache="10"><span style="font-family: Courier New, Courier, monospace;">
<div>
<span style="color: #674ea7;"><b>sudo killall chrome</b></span></div>
<div>
<span style="color: #674ea7;"><b>#xinput list # list input devices </b></span></div>
<div>
<span style="color: #674ea7;"><b>google-chrome --touch-devices=10 &</b></span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</span></span></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1tag:blogger.com,1999:blog-8819284282894548281.post-155978667569031432015-02-17T22:01:00.002+01:002015-02-17T22:01:41.805+01:00Android SMS to HTML backup / exporterThe application <b><i>SMS to HTML exporter</i></b> that I recently published for the<i> Android<span style="background-color: white; color: #545454; font-family: arial, sans-serif; font-size: x-small; line-height: 18.2000007629395px;">™</span></i> platform enables the user to easily export all his/her messages into a convenient HTML format that can be sent to a desirable email address instantly.<br />
<br />
The fresh, material-design inspired and simple user interface should get anyone going in moments.<br />
<br />
The application can be downloaded from Google-Play: <a href="https://play.google.com/store/apps/details?id=com.bkosarzycki.smstohtmlexporter" target="_blank">here</a><br />
<br />
or just copy-paste this address:<br />
<i>https://play.google.com/store/apps/details?id=com.bkosarzycki.smstohtmlexporter</i><br />
<br />
Screenshots:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150559.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150559.png" height="200" width="120" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150625.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150625.png" height="200" width="120" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150640.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage3/device-2015-02-16-150640.png" height="200" width="120" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com21tag:blogger.com,1999:blog-8819284282894548281.post-46040168894329766792015-02-03T12:16:00.003+01:002015-02-03T12:16:29.407+01:00Git - show number of project lines of code for a specific user<br />
To see number of:<br />
<br />
<ul>
<li>added lines</li>
<li>removed lines</li>
<li>total lines of code</li>
</ul>
<div>
for a specific user, use the following:</div>
<br />
<br />
<span style="color: #3d85c6; font-family: Courier New, Courier, monospace;"><b>git log --author="Name Surname" --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -</b></span><br />
<div>
<span style="color: #3d85c6; font-family: Courier New, Courier, monospace;"><b><br /></b></span></div>
<div>
<span style="color: #3d85c6; font-family: Courier New, Courier, monospace;"><b><br /></b></span></div>
<div>
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com3tag:blogger.com,1999:blog-8819284282894548281.post-63900954304453388572015-02-03T12:08:00.001+01:002015-02-03T12:08:24.362+01:00Android project - count lines of codeIn the project directory execute the following command. It searches for all *.java files and counts their lines of code - ignoring _*.java files which are generated by Android Annotations.<br />
<br />
<br />
<br />
<i><b><span style="font-size: large;">find . -name '*.java' -not -name '*_.java' | xargs wc -l</span></b></i><br />
<i><br /></i>
<i><br /></i>
<i><br /></i>Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1tag:blogger.com,1999:blog-8819284282894548281.post-60601491667140199952014-12-23T14:35:00.002+01:002014-12-23T14:35:24.176+01:00Add JavaScript/CSS syntax highlighting in Android Studio<ul>
<li>From Android Studio Menu, go to File -> Import Settings...</li>
<li>Locate the settings.jar file from this repository</li>
<li>From "Select Components to Import" make sure you have "File types" checked, then press OK</li>
</ul>
<br />
Download this file:<br />
<a href="https://github.com/manifestinteractive/android-studio-filetypes/blob/master/settings.jar">https://github.com/manifestinteractive/android-studio-filetypes/blob/master/settings.jar</a><br />
<br />
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1tag:blogger.com,1999:blog-8819284282894548281.post-76518054584175613512014-12-12T15:05:00.001+01:002014-12-12T15:36:14.388+01:00Android: get sha from *.apk file; validate *.apk content; check apk integrityThe apk file might get destroyed when it's transferred through a network. If the file is signed with a certificate (most Android applications are signed by the publisher) you can check the file integrity from the command line before installing the application. The following methods check the certificate validity as well as validate <b>apk file contents</b>.<br />
<br />
<br />
<pre><code>
<b>keytool -list -printcert -jarfile app-sa.apk</b>
</code>
</pre>
(java/jre/bin/keytool)<br />
<br />
<br />
<pre style="border: 1px dashed #CCCCCC; color: white; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: white; word-wrap: normal;"> Signer #1:
Signature:
Owner: CN=Somevalue, OU=Developers, O=Somevalue. Somevalue, L=Somevalue, ST=Somevalue, C=PL
Issuer: CN=Somevaluei, OU=Developers, O=Somevalue Somevalue, L=Somevalue, ST=Somevalue, C=PL
Serial number: Somevalue
Valid from: Thu Jul 17 11:25:00 CEST 2014 until: Mon Jul 11 11:25:00 CEST 2039
Certificate fingerprints:
MD5: 11:11:11:11:11:11:11:11:11:11:A3:D8:B5:11:11:11
SHA1: 11:11:11:11:11:11:11:11:11:0D:42:BC:2D:01:11:11:11:11:11:11
SHA256: 11:11:11:11:11:11:11:11:11:11:11:11:D4:7C:B7:1C:C8:14:8E:43:11:11:11:11:11:11:11:11:3E:11:11:11
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 11 11 11 11 11 11 11 11 11 11 11 11 11 11 36 F3 ..]....%.B....6.
0010: 11 11 11 11 ....
]
]
</code></pre>
<br />
<pre><code>
<b>jarsigner -verbose -verify -certs app-sa.apk</b>
</code>
</pre>
(java/jre/bin/jarsigner)<br />
<br />
<pre style="border: 1px dashed rgb(204, 204, 204); height: auto; overflow: auto; padding: 0px; width: 646.46875px;"><code style="word-wrap: normal;"><span style="font-family: arial;"><span style="font-size: 12px; line-height: 20px;">
</span></span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">sm 162096 Thu Dec 11 16:39:46 CET 2014 resources.arsc
X.509, CN=Somevalue, OU=Developers, O=</span></span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;"> </span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, L=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, ST=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, C=PL</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">
</span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;"> [certificate is valid from 7/17/14 11:25 AM to 7/11/39 11:25 AM]
[CertPath not validated: Path does not chain with any of the trust anchors]
sm 4416396 Thu Dec 11 16:40:46 CET 2014 classes.dex
</span></span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">X.509, CN=Somevalue, OU=Developers, O=</span></span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;"> </span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, L=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, ST=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, C=PL</span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">
[certificate is valid from 7/17/14 11:25 AM to 7/11/39 11:25 AM]
[CertPath not validated: Path does not chain with any of the trust anchors]
sm 621 Thu Dec 11 16:40:48 CET 2014 androidannotations-api.properties
</span></span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">X.509, CN=Somevalue, OU=Developers, O=</span></span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;"> </span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, L=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, ST=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, C=PL</span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">
[certificate is valid from 7/17/14 11:25 AM to 7/11/39 11:25 AM]
[CertPath not validated: Path does not chain with any of the trust anchors]
s 32963 Thu Dec 11 16:40:50 CET 2014 META-INF/MANIFEST.MF
</span></span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">X.509, CN=Somevalue, OU=Developers, O=</span></span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;"> </span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, L=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, ST=</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">Somevalue</span><span style="background-color: transparent; font-size: 12px; line-height: 20px;">, C=PL</span><span style="font-size: 12px; line-height: 20px;"><span style="background-color: transparent;">
[certificate is valid from 7/17/14 11:25 AM to 7/11/39 11:25 AM]
[CertPath not validated: Path does not chain with any of the trust anchors]
32984 Thu Dec 11 16:40:50 CET 2014 META-INF/CERT.SF
1495 Thu Dec 11 16:40:50 CET 2014 META-INF/CERT.RSA
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
<b>jar verified.</b></span>
</span></code></pre>
<span style="font-family: monospace;"><span style="font-size: 12px; line-height: 20px; white-space: pre;">The latter of the methods verifies apk content as well. </span></span><div>
<span style="font-family: monospace;"><span style="font-size: 12px; line-height: 20px; white-space: pre;"><br /></span></span><br />
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com10tag:blogger.com,1999:blog-8819284282894548281.post-18823251968402955022014-12-08T15:13:00.001+01:002014-12-08T15:13:11.227+01:00Android Studio - new Android 5.0 Lollipop emulators; Intel hardware-assisted virtualization; Android Studio Android 5.0 emulator landscape mode<br />
Google has released the new Android Studio 1.0 RC 4. It consists new Android emulators (in the SDK of course) which take full advantage of Intel hardware-assisted virtualization and can use the <b>host GPU</b>.<br />
<br />
<a href="https://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assisted-virtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-emulator" target="_blank">Here</a> is how to enable these on your Intel machine.<br />
<br />
<br />
<b><span style="font-size: large;">Android Emulator Shortcuts</span></b><br />
<br />
<b>Ctrl+F11 Switch layout orientation portrait/landscape backwards</b><br />
<br />
Ctrl+F12 Switch layout orientation portrait/landscape forwards<br />
<br />
Main Device Keys<br />
Home Home Button<br />
<br />
F2 Left Softkey / Menu / Settings button (or Page up)<br />
<br />
Shift+f2 Right Softkey / Star button (or Page down)<br />
<br />
Esc Back Button<br />
<br />
F3 Call/ dial Button<br />
<br />
F4 Hang up / end call button<br />
<br />
F5 Search Button<br />
<br />
Other Device Keys<br />
Ctrl+F5 Volume up (or + on numeric keyboard with Num Lock off) Ctrl+F6 Volume down (or + on numeric keyboard with Num Lock off) F7 Power Button Ctrl+F3 Camera Button<br />
<br />
Ctrl+F11 Switch layout orientation portrait/landscape backwards<br />
<br />
Ctrl+F12 Switch layout orientation portrait/landscape forwards<br />
<br />
F8 Toggle cell network<br />
<br />
F9 Toggle code profiling<br />
<br />
Alt+Enter Toggle fullscreen mode<br />
<br />
F6 Toggle trackball mode<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage3/GoogleEmulator_AndroidStudio1.0RC4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage3/GoogleEmulator_AndroidStudio1.0RC4.png" height="320" width="246" /></a></div>
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com3tag:blogger.com,1999:blog-8819284282894548281.post-90096240422045179592014-12-07T13:29:00.001+01:002014-12-07T13:29:28.225+01:00Ubuntu mount nfs shareUbuntu does not come with nfs server so we need to install it:<br />
<br />
$ <span style="font-family: Courier New, Courier, monospace;">sudo apt-get install nfs-kernel-server</span><br />
<br />
Then we can mount nfs shares like this:<br />
<br />
$ <span style="font-family: Courier New, Courier, monospace;"><b>sudo mount 1.2.3.4:/home /home/user/nfs/home</b></span><br />
<br />
<br />
to check whether the share mounted successfully:<br />
<br />
mount -t nfs<br />
<br />
<br />
<a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04" target="_blank">more info</a><br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com0tag:blogger.com,1999:blog-8819284282894548281.post-13467404434529295722014-11-28T14:20:00.007+01:002015-01-13T08:16:18.507+01:00Ubuntu 14.04 - how to create shortcuts in unity launcherTo create a shortcut to an application <b>in unity launcher </b>just make in a symlink in one of the following locations:<br />
<br />
<b>/home/user/.local/share/applications</b><br />
<br />
or<br />
<br />
<b>/usr/share/applications</b><br />
<br />
or<br />
<br />
<b>/usr/local/share/applications</b><br />
<br />
Example command:<br />
<br />
ln -s /home/user/applicationsFolder/app1 /usr/share/applications/app1<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/CreateShortcutUbuntu14.04__2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/CreateShortcutUbuntu14.04__2.png" height="180" width="320" /></a></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: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/CreateShortcutUbuntu14.04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/CreateShortcutUbuntu14.04.png" height="180" width="320" /></a></div>
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com0tag:blogger.com,1999:blog-8819284282894548281.post-54020388229949586312014-11-28T00:23:00.003+01:002014-11-28T00:23:58.191+01:00Build Android apps as Chrome apps/extensions, Build Android apps for ChromeOS, configure build server What I want to accomplish is configure a build server (like TeamCity) to build an Android application from source and convert it to a chrome extension that can be published on Chrome WebStore as an application.<br />
<br />
First of all you can read this <a href="http://lifehacker.com/how-to-run-android-apps-inside-chrome-on-any-desktop-op-1637564101" target="_blank">source</a> which explains how to run android apps in chrome.<br />
<br />
1. <a href="https://bitbucket.org/vladikoff/archon/get/v1.0.zip" target="_blank">Download</a> ARChon runtime and install it as an extenion in Chrome.<br />
<br />
2. You can convert your apk manually with <a href="https://chrome.google.com/webstore/detail/twerk/jhdnjmjhmfihbfjdgmnappnoaehnhiaf" target="_blank">this</a> chrome extension - <b>Twerk</b><br />
<b><br /></b>
3. To enable Chrome App Launcher on Ubuntu (speeds up app launching) - follow <a href="http://www.omgchrome.com/enable-chrome-app-launcher-linux/" target="_blank">this</a> link.<br />
<br />
4. Install <b>chromeos-apk</b><br />
asdsa<br />
<br />
<ol style="background-color: white; box-sizing: border-box; color: #222222; counter-reset: item 0; font-family: Georgia, serif; font-size: 0.9375rem; line-height: 24px; list-style-position: outside; list-style-type: none; margin: 0px 0px 1.5rem 1.125rem; padding: 0px; position: static;">
<li data-textannotation-id="60a77ce525ee2a9f4c394538cc8207a6" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">In a terminal, run the following command: <code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">sudo apt-get install npm</code></li>
<li data-textannotation-id="c0d5dec07c4a666f501a22b1c832aa94" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;"><em style="box-sizing: border-box; line-height: inherit;">(Ubuntu only): </em>Run the following command: <code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">sudo apt-get install lib32stdc++6</code></li>
<li data-textannotation-id="60b8271b83b93cc10f8d0d18d24e0bcd" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">Download <a href="http://nodejs.org/" sl-processed="1" style="box-sizing: border-box; color: #709602; line-height: inherit; text-decoration: none;" target="_blank">node.js</a>.<span class="annotation-footnote-wrapper clearfix" style="box-sizing: border-box; display: inline-block;"></span><span class="annotateButton js_text-annotate text-annotation-button icon icon-plus-circle" style="-webkit-transition: all 0.1s linear; -webkit-user-select: none; box-sizing: border-box; color: #666666; cursor: pointer; display: inline-block; font-family: KinjaIcons; font-size: 16px; height: 16px; left: auto; line-height: 16px; margin-left: 7px; opacity: 0; position: relative; text-align: center; text-rendering: optimizelegibility; transition: all 0.1s linear; vertical-align: middle; width: 16px;"></span></li>
<li data-textannotation-id="6b92f399d0ee09f56a88e2e94a30bd62" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">Unzip the tar.gz file you downloaded from the above link.<span class="annotation-footnote-wrapper clearfix" style="box-sizing: border-box; display: inline-block;"></span><span class="annotateButton js_text-annotate text-annotation-button icon icon-plus-circle" style="-webkit-transition: all 0.1s linear; -webkit-user-select: none; box-sizing: border-box; color: #666666; cursor: pointer; display: inline-block; font-family: KinjaIcons; font-size: 16px; height: 16px; left: auto; line-height: 16px; margin-left: 7px; opacity: 0; position: relative; text-align: center; text-rendering: optimizelegibility; transition: all 0.1s linear; vertical-align: middle; width: 16px;"></span></li>
<li data-textannotation-id="59da500a424de7f1ee0bd5e54f45e450" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">Per the README file, open a terminal to the unzipped folder containing node.js. And run the following commands in order:<ol style="box-sizing: border-box; counter-reset: item 0; font-family: inherit; font-size: 0.9375rem; line-height: 1.6; list-style-position: outside; list-style-type: none; margin: 0px 0px 0px 1.125rem; padding: 0px; position: static;">
<li data-textannotation-id="1074ef0e7fc1479ed4b3aadde20afe6e" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;"><code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">./configure</code></li>
<li data-textannotation-id="842c0208f4d642fb1cde17d74790d01c" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;"><code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">make</code></li>
<li data-textannotation-id="9771f6f6bffeac31585f4b5eb7483a91" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;"><code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">make install</code></li>
</ol>
</li>
<li data-textannotation-id="88bec0f2180eb4d5601d4e9646055517" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">Run the command: <code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">sudo npm install chromeos-apk -g</code></li>
<li data-textannotation-id="cb5247dd0419caca8f17a64ef7717e41" style="box-sizing: border-box; margin: 0px 0px 6px; padding: 0px 0px 0px 1.125rem;">To make sure you're updated to the latest version (now or in the future), run: <code style="background-color: whitesmoke; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; display: inline-block; font-family: Courier, monospace; padding: 0px 7px;">sudo npm install -g chromeos-apk@latest</code></li>
</ol>
5. Convert your compiled application in apk to chrome app with:<br />
<br />
chromeos-apk --tablet --scale --name ApplicationName application.apk<br />
<div>
<br /></div>
<br />
5. Remember - to update the chromeos-apk plugin just run:<br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: Courier, monospace; font-size: 15px; line-height: 24px;">sudo npm install -g chromeos-apk@latest</span>Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com5tag:blogger.com,1999:blog-8819284282894548281.post-11590640685267336862014-11-27T11:52:00.000+01:002014-11-27T11:52:31.158+01:00Install CyanogenMod 11 on XPeria P running stock Android 4.11. First of all you need to <b>unlock</b> your bootloader. [worked]<br />
Go <a href="http://developer.sonymobile.com/unlockbootloader/" target="_blank">developer_sony</a> to proceed with unlocking (official SONY's website)<br />
<br />
<ol style="-webkit-font-smoothing: antialiased; color: #686868; font-family: Helvetica, Arial, Tahoma, Verdana, sans-serif; font-size: 13px; margin: 0px; padding: 5px 0px 0px 40px;">
<li style="-webkit-font-smoothing: antialiased; letter-spacing: 0px; margin: 0px 0px 3px; padding-bottom: 3px;">In your device, open the dialler and enter <strong style="-webkit-font-smoothing: antialiased;">*#*#7378423#*#*</strong> to access the service menu.</li>
<li style="-webkit-font-smoothing: antialiased; letter-spacing: 0px; margin: 0px 0px 3px; padding-bottom: 3px;">Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can continue with the next step. If it says No, or if the status is missing, your device cannot be unlocked.</li>
</ol>
<br />
<br />
2. Then you need to root your XPeria P [worked]<br />
The following root method worked for me:<br />
<a href="http://forum.xda-developers.com/showthread.php?t=2327472" target="_blank">DooMLoRD Easy Rooting Toolkit (v17) </a><br />
<br />
<br />
3. To install CWM [worked]<br />
<br />
<a href="http://forum.xda-developers.com/xperia-u/p-development/cwm-cwm-recovery-6-0-1-2-locked-t2020895" target="_blank">CWM xda link</a><br />
You need to have root access in order to use this method.<br />
It worked fine for me.<br />
<br />
CyanogenMod 11 <b>did NOT install</b> from CWM for me. It started fine and then couldn't read the phone model number properly.<br />
<br />
<br />
4. To install TWRP [did not work as expected]<br />
<br />
extract <b>boot.img </b>from cm-11-20141012-SNAPSHOT-M11-nypon.zip and copy it to the main script directory.<br />
<br />
flash the boot image in fastboot mode with:<br />
sudo fastboot flash boot boot.img<br />
<br />
<br />
4. Cyanogemod 11 link<br />
<br />
http://forum.xda-developers.com/xperia-u/p-development/rom-cyanogenmod-11-0-t2626639<br />
<br />
<br />
Workaround:<br />
After 1,2,4 (After flashing boot.img )<br />
enter CWM and try to flash CyanogenMod. The device will restart and enter bootloop. Try pressing power button to enter TWRP.<br />
Then flash cyanogenmod normally.<br />
<br />
<br />
<u>HOW TO ENTER RECOVERY MODE in Xperia P</u><br />
<br />
<a href="http://forum.xda-developers.com/xperia-u/issues/how-to-enter-recovery-mode-xperia-p-t2661073" target="_blank">howto</a><br />
<br />
<i>CyanogenMod</i>:<br />
1.press power + volume up for 3 seconds until the phone vibrates<br />
2. keep on pressing volume up <b>multiple</b> times until clockworkmod recovery shows<br />
<br />
<i>TWRP</i><br />
1.press power + volume up for 3 seconds until the phone vibrates<br />
2. keep on pressing power until twrp showsBartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com0tag:blogger.com,1999:blog-8819284282894548281.post-44258453131714320742014-10-20T16:40:00.000+02:002014-10-20T16:40:11.933+02:00Android Annotations - create @EBean instance from code; Android Annotations inject from code; create instance dynamicallyUsually when you need an instance of @EBean you simply use inversion of control:<br />
<br />
@EBean<br />
public class Upgrade0001 implements IUpgrade {<br />
<br />
@Bean<br />
protected SDao mSDao;<br />
}<br />
<br />
<br />
@EActivity(R.layout.activity_some)<br />
public class SomeActivity extends Activity {<br />
@Bean<br />
protected Upgrade0001 mUpgrade0001;<br />
}<br />
<br />
<br />
but what if you wanted to <b>dynamically</b> create an instance of @EBean <b>from code</b>?<br />
<br />
Simple reflection won't help - mSDao will be null:<br />
<br />
<br />
<span style="font-family: Verdana, sans-serif;">IUpgrade upgrade = (IUpgrade) Class.forName("Upgrade0001_").newInstance();</span><br />
<br />
<br />
Just call the <b>getInstance_</b> method which every AndroidAnnotations class implements:<br />
<br />
<br />
<span style="font-family: Verdana, sans-serif;">Method m = Class</span><br />
<span style="font-family: Verdana, sans-serif;"> .forName(upgradeItem.getUpgradeClassName())<br /> .getMethod("getInstance_", Context.class);</span><br />
<span style="font-family: Verdana, sans-serif;">Object result = m.invoke(null, this.getApplicationContext());</span><br />
<span style="font-family: Verdana, sans-serif;">IUpgrade upgrade = (IUpgrade)result;</span><br />
<div>
<br /></div>
Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com0tag:blogger.com,1999:blog-8819284282894548281.post-24278372638565709102014-07-24T11:58:00.003+02:002014-07-24T11:58:38.658+02:00Ubuntu 14.04 - convert multiple images to *.pdfTo convert all (multiple) images in a folder to a single pdf file you can just type:<br />
<br />
<br /><b><span style="font-family: Courier New, Courier, monospace;">convert -compress jpeg * output_file.pdf</span></b><br /><br /><br />inside the folder with the photos.<br />
<br />
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com5tag:blogger.com,1999:blog-8819284282894548281.post-19416188863628205512014-07-22T10:33:00.002+02:002014-07-22T10:33:11.509+02:00Ubuntu 14.04 - install BIMP - Batch image manipulationBIMP is useful to apply filter to multiple images in GIMP.<br />
<br />
HOW TO INSTALL BIMP on Ubuntu 14.04 x64<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install libgimp2.0-dev</span><br />
(optionally:<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get build-dep gimp</span>)<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">make</span><br />
<span style="font-family: Courier New, Courier, monospace;">make install</span><br />
<br />
<br />
Homepage: <a href="http://registry.gimp.org/node/26259">http://registry.gimp.org/node/26259</a><br />
<br />
Compiled binary for Ubuntu 14.04 x64<br />
<a href="http://sites.google.com/site/bkosarzyckistorage2/bimp" target="_blank">download</a><br />
<br />
just copy this binary to:<br />
~/.gimp-2.8/plug-ins/bimp<br />
chmod 772 ~/.gimp-2.8/plug-ins/bimp<br />
<br />
<br />
<br />
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com6tag:blogger.com,1999:blog-8819284282894548281.post-53981077309294928452014-07-02T10:13:00.002+02:002014-07-02T10:16:16.038+02:00Android L preview Emulator under UBUNTU 14.04 x64 & Windows 7 x64 - optimal settingsUBUNTU 14.04 x64:<br />
<br />
sudo apt-get install cpu-checker<br />
<br />
<br />
$ kvm-ok<br />
INFO: /dev/kvm exists<br />
KVM acceleration can be used<br />
<div>
<br />
<br />
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils<br />
<br />
export LD_LIBRARY_PATH=/home/your_user_name/Develop/android-sdk/tools/lib:$LD_LIBRARY_PATH<br />
<br />
sudo apt-get install libgl1-mesa-dev<br />
<br />
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so<br />
<br />
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/AndroidL_Nexus5_Emulator_Settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/AndroidL_Nexus5_Emulator_Settings.png" height="320" width="220" /></a></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;">
Start the emulator with:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
./emulator-x86 -avd your_avd_name -qemu -m 2047 -enable-kvm</div>
<div>
<span style="background-color: white; line-height: 19.512001037597656px;"><span style="color: #53575e; font-family: Arial, 宋体, Tahoma, Helvetica, sans-serif; font-size: x-small;"><br /></span></span></div>
<div>
1) select Intel Atom (x86) - for VT-x to work<br />
2) skin - select WVGA800 - for other skins the emulator is too big/small<br />
3) remember to check "Use host GPU"</div>
<div>
<span style="background-color: white; color: #53575e; font-family: Arial, 宋体, Tahoma, Helvetica, sans-serif; font-size: 13px; line-height: 19.512001037597656px;"><br /></span></div>
<div>
<span style="background-color: white; color: #53575e; font-family: Arial, 宋体, Tahoma, Helvetica, sans-serif; font-size: 13px; line-height: 19.512001037597656px;"><a href="https://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assisted-virtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-gingerbread-emulator" target="_blank">intel support</a></span></div>
<br />
<br />
WINDOWS:<br />
<br />
Install:<br />
Intel(R) Hardware Accelerated Execution Manager (HAXM)<br />
with Intel(R) Virtualization Technology (VT)<br />
<br />
It's really a must. Without HAXM the emulator is dead slow. Also remember to enable VT-x on your mainboard's BIOS settings for HAXM to work.<br />
<br />
1) select Intel Atom (x86) - for VT-x to work<br />
2) skin - select WVGA800 - for other skins the emulator is too big/small<br />
3) do not set more than 700 MB of RAM - Windows does not handle that well<br />
4) remember to check "Use host GPU"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sites.google.com/site/bkosarzyckistorage2/Emulator_Windows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://sites.google.com/site/bkosarzyckistorage2/Emulator_Windows.png" height="320" width="221" /></a></div>
<br />
<br />
<br />Bartosz Kosarzyckihttp://www.blogger.com/profile/17200768831466327121noreply@blogger.com1