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
3d Mobile phones

My first Thing on Thingiverse!

2017-02-17 09.18.33
Just wanted to share the first Thing I uploaded to Thingiverse (which is a huge open-source collection of 3D-printable or otherwise fabricateable objects).
It’s a 1/4-20 (standard camera mount) holder for a smartphone using a rubber band.
I saw many designs that use screws to hold the phone in place, but I didn’t have such screws and I had many loose rubber bands. Also a rubber band allows the phone to snap in and out more easily.
It’s a very basic 3D design I did with FreeCAD, then made it on my FlashForge Creator Pro.
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
linux Mobile phones Networking Raspberry Pi Recommended Software tips

Push a file to your Smartphone

This is a quick tip. If you need to push a notification to your smartphone, or even send a file, I recently stumbled upon “Pushbullet“.
I was looking for a solution to send a file (with automatic download) to my phone, via bash script on my raspberry pi. I’ve been using pushover for a while, but as far as I know, it doesn’t support files
I have read the Pushbullet API, and came to realise that sending a file have 3 steps
1. Getting credentials to send the file
2. Upload the file to a remote server
3. Send a notification of “file” type with the download url
Of course, you can do 1 and 2 youself if you have access to a place which stores the file (I also managed to send a dropbox download link)
You need to sign up for Pushbullet via web, to get the api key, and also install the app on your smartphone (obviously)
So here is the bash script (It’s not elegant – but it works)

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.