Geek Garage

Find inspiration in awesome ideas.

Tag: Android (Page 1 of 2)

Upgrading to Yosemite and Android Studio

I just upgraded to Os X Yosemite and ran into some issues to have Android Studio running properly. Some things must be checked right after the upgrade. But you will have the same issues on a new Mac while installing your development tools. So, check this out.

You must remember that Java is no more part of Os X. So every time you upgrade Os X, you have to install it again. If not, launching any JetBrains software will pop up this message.

Java not found dialog

Actually, this message is a little misleading. If you google the problem, the solution is straightforward: you’ll have to change the value of the required jdk version in a configuration file. You just have to find the file Info.plist which is located into:

/Applications/Android\ Studio.app/Contents/

Edit that file, look for the following lines:

      <key>JVMVersion</key>
      <string>1.6*</string>

And make the following change

      <key>JVMVersion</key>
      <string>1.6+</string>

So now you are supposed to launch properly Android Studio. Unfortunately, you may see the same message again… Sounds weird until you check your Java version.

java -version

And this is how I remembered that Java was removed by the system… Told you the message could be misleading. Just install a JDK and your IDE should launch properly.

This setting is not restricted to Android Studio. Actually, you should edit the Info.plist file for every one of your JetBrains software. They should be in your Applications folder. I had to update the configuration file for PyCharm, located into

/Applications/PyCharm CE.app/Contents

Unfortunately, you’ll have to get used to this. Every time I updated Android Studio, the process asked for an update of this configuration file which will roll back your modifications.

Back to Android Studio. Once I launched it, the project loaded properly, but unfortunately stopped with the following message.

Gradle can't find javaHome dialog

The trick is that the JavaVirtualMachines is no longer into this path but into /Library/Java. So you may have to correct that value either.

Now, you are good to go.

Using the Dropbox SDK with Android Studio and Gradle

Dropbox DeveloperDropbox provides a set of interesting online services. Last year, they released a nice feature, the Datastore API. The documentation is good, but meant for using with Eclipse. If like me, you are using Android Studio, you will have to look for some more steps to make this working.

I gathered all of them into this single post.

Read More

Android, how to programmatically get a ressource

BIG T3 view

On BIG T3, the flags are resources loaded dynamically.

This was my problem: in the application Brothers In Games T3, I needed to display some images depending on a parameter. Those images are country flags and are the one of the country where the event is located. Those flags images are resources stored in the app. Their name is standardized with the country ISO code.

Now, how to load a resource when you have to compose its name ? I mean something more elegant than a brute if country then load resource elsif other country…

Fortunately, Android offers an elegant and easy way to do so, but maybe not that obvious, so lets see how it works.

Read More

Referencing a local aar file in Android Studio

If you have created a library in Android Studio, you certainly want to use it in another project. The easiest way should be to create the aar file and then reference it from your new project. Prior to Android Studio 0.4.4, referencing local aar files was not supported as you can see from Xavier Ducrohet or in this issue report.

But there is an easy workaround for this. Lets see what we have to do, lets say, after you’ve created a stand alone library.

Read More

Date manipulation curse from Java in Android

Java does certainly have the reputation of the worst date manipulation features. This all comes with the bad designed Calendar API. Hopefully, there are better third-party APIs and if you have to manipulate dates, moment, times… You certainly prefer JodaTime. From my point of view, it’s a no brainer.

I was working on a date picker for an Android project and found that the SDK provided a set of convenient methods and interfaces. But this lead to a little bug in the interface, a little shift in the displayed date. Of course, this comes from the old Java Calendar API curse and from a lack of precision in the documentation.

Read More

Parsing RSS feed from an Android device

When it comes to RSS feed parsing, any Java developer will use the org.xml.sax library. But Android provides a nice wrapper that simplifies the code without sacrificing the performances. This wrapper is present since API level 1 and is the easiest way to write a simple parser for any XML.

In this tutorial, I’ll show you how to parse a RSS feed using the android.sax package. I’ll use Geek Garage’s feed. As any XML parsing, using the android.sax package, you can ignore the elements you don’t need, so, I’ll only collect some of the items.

Read More

Create a standalone library with Android Studio

As a software developer, you know that reusable ressources should be in libraries. Android is a Java-based technology, so, your library can be a jar file. But if you want to store some Android specific resources, you need to create a Android Library Project.

Google released Android Studio as the main development platform for Android. Android Studio is a packages IntelliJ Idea environment and relies on Gradle for the build management. At the time being, it is a little unclear how to manage a library so this is a first tutorial.

Read More

How to respectfully get your user contact details ?

My app KipinTooch is a kind of contact management app. I created it with the following intentions:

  • Have a better view among the common informations from different contacts.
  • Highlight the relations between contacts.
  • Allow a batch modification for those informations.
  • Help filling informations in a contact card based on similar contacts.

I also wanted the starting point to be the user. So, the app need to gather some informations about the user. But I also wanted the app to be self-sufficient. The app should process data from the phone and everything is done on the phone. No third party social network, no sending to a unknown distant server which would do its magic. This is what I call to be respectful: the user private data remains private and on its device.

This mean that if you want to provide the user some similar informations, you can only rely on what’s on the device. In this post, I will show you how you can gather those informations.

Read More

Format your string resources on Android

There are many tutorials on the web about String formatting on Android. Unfortunately, most of them are about the usual String.format method. In this post, I’ll show you the different ways to display your message.

Read More

The Iron Kingdoms on Kindle.

Skull Island Expeditions is an imprint of Privateer Press producing fantasy fiction. Their first 3 novels are now available on Kindle trough the Amazon.

The Devil's Pay cover.

The Devil’s Pay cover.

Privateer Press is certainly the first table top miniature games company to take advantage of modern devices. War Room, their card library app was published last summer. This April, trough Skull Island Expeditions, they are focusing on publishing books on digital format.

Their first 3 books are available on Kindle for a reasonable price, $5.14. Kindle is not limited to Amazon’s tablets. You can find the app for your Android or iOS device. You are allowed to get the book on multiple devices so you can start reading on one and continue on another. You are also allowed to lend the book.

You can still save $0.15 per book if you want to buy them trough Skull Island Expeditions site. The books are available in pdf, mobi or epub.

If you want to dive deeper in the universe of the Iron Kingdoms, those books are for you. Feel free to tell us how you enjoyed them.

Page 1 of 2

Powered by WordPress & Theme by Anders Norén