Categories
Android Java video

Android Camera2 Touch-to-Focus

Man Camera2 APIs are hard to master…
I’ve scanned SO for a way to get touch-to-focus to work on Android and could not find a solution that works.
These were very partial, or provided only scaffold code which I couldn’t use:

Finally I was able to do it by myself this way:

Enjoy
Roy

Categories
Android ffmpeg linux Music Networking Solutions Stream

FFMpeg with Lame MP3 and streaming for the Arduino Yun

So, I’ve been trying to stream audio off of a USB microphone connected to an Arduino Yun.
Looking into it online I found some examples using ffserver & ffmpeg, which sounded like they could do the trick.
However right from the start I’ve had many problems with playing the streams on Android and iOS devices.
Seems Android likes a certain list of codecs (http://developer.android.com/guide/appendix/media-formats.html) and iOS like a different set of codecs (Link here), but they do have on codec in common – good ol’ MP3.
Unfortunately, the OpenWRT on the Arduino Yun has an ffmpeg build which does not provide MP3 encoding… it does have the MP3 muxer/container format, but streaming anything other then MP3 in it (for example MP2, which the Yun-ffmpeg does have) simply doesn’t work on the Android/iOS.
From experiments streaming from my PC a ffmpeg/libmp3lame MP3 stream, it looks like the mobile devices are quite happy with it – so I will need to recompile ffmpeg with Lame MP3 support to be able to stream it.

Categories
Android Mobile phones Solutions

A Creative way to bypass Pattern lock on Android

Let me start putting everything on the table – this post will describe how I eventually managed to unlock an unrooted, non-Google account linked Samsung Galaxy Mini Plus (GT-5570I) device without ADB support. There are a lot of guides on how to bypass this pattern lock on Android (and I will provide some links), but the purpose of this post is to show how looking for creative ways to do this can come handy

So a friend gave me a locked device. This device had no Google account linked to it (which prevented me from bypassing the lock with that account), there was no root or ADB access via recovery, and the USB debugging option was disabled.

I found this guide here, which states some commands you can type in ADB shell and should deactivate the pattern lock. So – How do I get ADB access on that phone?

Categories
Android Solutions

Android Market's apps compatibility problem [w/ solution]


WOW That was annoying! From the moment I started using a custom ROM on my Samsung Galaxy S2 (Cognition S2, to be exact), I started having issues with some apps.

Sometimes they won’t appear in search results, other times it will just say it’s not compatible. It drove me nuts!

Naturally I started with the forums – All the solutions there were about LCD DPI change. Funny, I never thought of that, but it did make sense. The only problem was that I never touched my DPI settings (Heck, I didn’t know I could).

(On a side note – tampering with the density is pretty cool… if you want to try it, you can download apps from the Market like LCD Density)

Back to my problem…

Categories
Android code graphics gui Java Mobile phones programming tips

Android frame animation revisited [w/ code]

So, been working hard on my projects, and discovered some interesting things in Android possibilities for frame animation. Last time I was using an HTML approach, because of memory consumption issues with using ImageViews. However now my approach is using View.onDraw(Canvas) to draw BMPs straight off files, in an asynchronous way, and it seems to work pretty good.
Let me tell you how I did it

Categories
Android Mobile phones

Number Saver gets a new look

Number Saver has been around for a while, but when I got around to it, it was always Number Saver App Iconabout the features. I felt the time is right to polish (even a bit) my Android UI skills and try and make it.

Categories
Android code graphics Java linux Mobile phones programming Solutions

Some things I learned about Android's Frame animation

Hi
Just a quick share of lessons learned about Android’s Frame-by-Frame animations. Some of the functionality is poorly documented, as many people point out, so the web is the only place for answers. Having looked for some answers to these questions and couldn’t find any – here’s what I found out myself.
Update [2/3/11]: A new post on this topic gives a more broad view of my experience.

Categories
Android code Java Mobile phones programming tips

Reading contacts in Android 2.0+

On one of my Android apps, I added a trivial option to select a contact from the phone’s contact list. This was working fine until SDK version 5, which changed the way the contacts are represented in the phone’s SQLite database. It is using the “newer” class called ContactsContract instead of the deprecated People class

I have spent quite time in order to figure out which was the best way that will fit my needs. If you are in the same position, feel free to use the code below

My example below is will display a two row list of all the contacts, with alphabetical indexing. It is a mixture of code snippets I have found on the net, while may not be optimized; it will definitely give you the hang of things.

Categories
Android Recommended Software Solutions Stream tips

An Android solution for listening to online radio while multitasking

Android + Yourmuze.fm + Dolphin Browser HD + XiiaLive = WIN

It’s been a while since I’ve posted anything in the blog… Sorry for that… very busy times. I had a lot of ideas of what my “comeback post” should be about, but I knew I had to share one of my relatively recent discoveries that made my smartphone online-radio listening experience a whole lot better
If you don’t know yourmuze.fm, this might be the time to get to know it. It’s a free service that has a LOT of worldwide radio stations available as an online stream for usage with most of the smartphones.
In order to start using it you need to register for free via your desktop computer, and add the stations you like. Later on, you can surf to the mobile version of the service by mobile web and listen to the stations you selected.
So far so good… I like it. But how about multitasking?

Categories
Android code Java opencv programming vision

OpenCV2.1 on Android quickey with Haar object detection [w/ code]

Hi!
Long time no post… MIT is kicking my ass with work. But it was amazing to come back to so many comments with people anxious to get OpenCV going mobile!
Anyway, just wanted to share my work on object detection using OpenCV2.1 on the Android.