Is there a way to enumerate the video devices on a Java ME phone? - java-me

I recently downloaded a barcode reading application for my phone, an LG KU990i (AKA the Viewty) However, there's a problem that renders the application nearly useless: the Viewty has 2 cameras -- the main one, and a secondary camera located on the face of the unit -- and it is the secondary camera that is unfortunately set as the phone's default video capture device. As you can't point the secondary at anything and see what it's pointing at at the same time, it makes it a bit difficult to snap a barcode!
According to the JSR-135 spec, it is possible to specify a video capture device other than the default... if you know the device name. This does not appear to be documented anywhere on LG's Web site, nor does the JSR-135 spec describe any way of enumerating the devices on a phone... or is there? Failing that, are there any naming conventions for video devices commonly in use that LG might be using?
I've logged a ticket with LG, but as it's an old device, I don't imagine them breaking their backs in getting back to me... I should also point out that this is purely for my own curiosity so no-one here should feel obliged to break their backs either!

As far as I know there is no way to get list of all available catpure:// urls.
All urls I know:
capture://image,
capture://video
capture://devcam0
capture://devcam1
Source:
http://www.forum.nokia.com/info/sw.nokia.com/id/bc00e4ce-7df3-4527-962c-d39843a808d0/MIDP_Mobile_Media_API_Support_In_Nokia_Devices_v1_0_en.pdf.html

LG responded to my support ticket. Apparently, it's not possible to access the primary camera on the Viewty from Java, making it pretty much useless for barcode scanning. Answer reproduced here for search engines.
You support ticket has been answered. Please visit the LG Mobile Developer Network and login to check the answer at [My Page > My Tickets].
KU990i default video capture device is the secondary camera
Answer :
Hi,
KU990i have to Two camera module
differently.
Main camera using Joran chipset and
sub(front camera) using Qualcomm
chipset.
Joran chip doesn’t supported JSR135.
Therefore, we couldn’t supported to
the JSR135 using for main camera.
(it is H/W limitation)
It was inform to operator already and
we remember operator was confirm it.
So that, we only supported sub camera
for JSR135.
BR,

Related

Feasibility of BlueTooth Reader and App Project

I'm working on a project to track delivery trucks leaving and returning to the office.
While I know RFID would work, we're also looking at BlueTooth with mobile apps. Ideally, once a driver installs the app, we register a unique ID for the device, and a BT reader identifies when phones/deliveries leave and enter range without any user interaction.
From the Android 6.0 release notes, it looks like the MAC address is hidden from apps and BT broadcasting. https://developer.android.com/about/versions/marshmallow/android-6.0-changes#behavior-hardware-id
User management of app installs and enabling BT aside, is this feasible?
Can someone point me in the right direction to confirm what identifiers are available?
When I understand you correctly you actually do not want to track where a phone is but want to know if a person/truck/phone passes a kind of checkpoint or gate?
For newer smart phones you cannot rely on the visible MAC. Bluetooth classic is usually not visible and the BLE MAC is randomized as long as the device is not paired and bonded.
Indeed as PaulW11 stated, the simple way would be to implement an app which does BLE advertising with short advertising interval. Inside this advertisment you can put some custom data. This will be visible to everyone. This ID can be some random number, a number assigned by you or whatever.
At the gate you would implement a BLE scanner grabbing all advertisments near to it.
This should be easy to implement.
I would also like to mention the drawbacks here: If someone passes the gate you may miss him. BLE with Android is always tricky and you might have the situation that the bluetooth subsystem on a phone may have stopped working or so.
One the other hand if someone comes accidently near to your gate, you will think he left or returned. Near can be something around 50 m or so with good conditions or only 10 in other cases.
And even worse: If someone stays 'nearly' in the range of the gate you will see im sporadically. This may confuse your come and go logic if he is visible every 3 minutes or so...

NFC handover to Bluetooth or WiFi for data transfer

I'm currently working on a project for an interactive visitor centre in Laguna Beach, CA.
There are many touchscreen devices around the space, which we are developing some cool software for, however one of the client requests is to allow visitors to transfer image, pdf and video files from an interactive coffee table touchscreen onto their phone.
The client has seen this on YouTube/CES etc.. You know, where someone puts a phone on a the interactive surface and then magically swipes images onto the phone from the screen.
Of course, if the visitor had a custom app on their phone, and was already on the same WiFi this would not be so much of a problem. I suspect this is what happens on these magic demos that we see.
In our situation, we don't want the visitor to download an app really, we just want the easiest solution and experience for the visitor. We have a public WiFi available to us, and we can install an NFC device on the touchscreen and the touchscreen also has bluetooth.
My ideal scenario would be for the user to pop their NFC enabled phone on the table, the table recognises it, pairs with BT or WiFi and away we go! I'm not sure how practical this is though having researched around. Clearly thats not going to work on an iPhone. I don't mind a couple of mechanisms i.e. one for Android/other NFC phones and one for iPhone.
Does anyone have any experience of this kind of thing and suggestions of how to handle it?!
Here's a mock up of our 32" Coffee Table touchscreen just for some context
Thanks for reading through and having a think :-)
I know that there is standardized way to pair Bluetooth device using NFC tag. I think this is the best solution for you. The authority that is standardizing this format is called NFC Forum. You can find more info about the topic in this document: Bluetooth Secure Simple Pairing Using NFC

Record audio from various internal devices in Android (via undocumented API)

I was wondering whether it is possible to capture audio data from other sources like the system out, FM radio, bluetooth headset, etc. I'm particularly interested in capturing audio from the FM radio and already investigated all possibilities including trying to sniff the raw bluetooth communication between the phone and the radio device with no luck. It's too bad Android only allows recording audio from the MIC.
I've looked at the Android source code and couldn't find a backdoor to allow me to do that without rooting the device. Do you, at least, have any idea how to use other devices (maybe access somehow /dev/audio) say via NDK or even better - Java (maybe Reflection?) to trick the system to capture the audio stream from say, the FM radio. (in my case I'm trying to develop the app for the HTC Desire)
PS. And for those of you who are against using undocumented APIs, please don't post here - I'm writing an app that will be for my personal use or even if I ever publish it I will warn the user of possible incompatibilities.
I've spent quite some time deciphering the audio stack, and I think you may try to hijack libaudio. You'll have trouble speaking directly to the hardware (/dev/*) because many devices use proprietary audio drivers. There's no rule in this regard.
However, the audio hardware abstraction layer (HAL) provided by /system/lib/libaudio.so should expose the API described at http://source.android.com/porting/audio.html
The Android system, and especially audioflinger, uses this libaudio HAL to find available devices, deal with routing, and of course to read/write PCM data.
So, you could hijack the interaction between audioflinger and libaudio, by renaming the later, and providing your own libaudio which decorates the real one. Doing so, you should be able to log what happens and very possibly intercept FM radio output, provided that this is not directly handled by the hardware.
Of course, all this requires rooting. Please comment if you manage to do this, that interests me.

Is it possible to make a computer behave as a bluetooth HID device?

Is it possible to make a computer behave as a bluetooth HID device? That is, given a local machine with a standard USB keyboard plugged into it, other devices could discover this machine and use it as a bluetooth keyboard.
I'd like to create a linux or OS X application (or use an existing one, though I've found none) which can behave as described above, but I'm not sure where to start, or if it's even possible.
So:
Is what I'm describing possible?
Are there any existing applications that do what I describe?
If no application already exists (I'm assuming not), are there bluetooth libraries or bindings that will help? (I'm pretty comfortable using most of today's popular languages, so I'd prefer a library most directly suited to the task, so long as it's available in linux or OS X.)
Failing any of the above, the bluetooth spec looks pretty dense. Are there specific guides or other starting points applicable to the problem at hand that I can read?
I realize that such an application would most likely need to steal the normal keyboard input, possibly providing some KVM-like hotkey for switching between providing input to the host operating system and sending the input over bluetooth to the connected device, but I'm considering that problem to be outside the scope of this question.
It is definitely possible on Linux. Some time ago I found this project:
http://nohands.sourceforge.net/index.html
They emulate a full-blown headset with audio and keyboard controls on the Linux bluetooth stack. If they can emulate something like that, you would probably be able to emulate something simpler like a keyboard.
It is possible, however I don't think I'll be able explain it very well and I don't know the entire answer. A BT HID device works as a server and waits for connections to come to it. In linux, using the bluez stack, first you would have to advertise the HID service for other devices to see. I think you do that using the sdp.h and sdp-lib.h header files(the second header maybe called something else, I'm on a windows computer and can't check). So you would have to add the HID service record to you computer for other devices to see it. You would have to create a program that first adds this service to the record, then waits for other devices to connect, then handle the pairing process, Bluez might handle this for you, or you might have to do some things to it, I'm not quite sure. You should also read the Bluetooth HID Spec found at the http://www.bluetooth.com/English/Technology/Building/Pages/Specification.aspx site. This document contains the details of the SDP record relevant to HID. Also the book Bluetooth essentials for programmers is pretty good to introduce you into bluetooth programming
I would like to have given a more concise answer, with more detail, but that's all I know ATM. I am also trying do something similar, but spare time is so hard to find ;) I'm also not on my Linux box and can't check all the details. If your are still interested, let me know and i'll try to expand my answer.
I don't know if this is helpful, nor if it is still alive and working, but perhaps you could try this link.
Another one that might or might not be helpful in some way is remuco, but I don't know if they are using a Bluetooth HID profile.
It is indeed entirely possible with Linux and Bluez. See: https://github.com/lkundrak/virtkbd/blob/master/btkbdd.pod
Try Across, unfortuantly for me my phone was lacking support.

How to programmatically use the mobile phone's IrDA to remote control a media player?

which API or library on which mobile OS is to be used when one needs to write a code to use the phone's IrDA to create the necessary impulses to remote control consumer electronics e.g. a HDD media player?
Is maybe a certain mobile OS better suited for that kind of application than others?
First you need to know that IrDA is not the best choice for remote control. It can be done, but IrDA is by design high speed/low range, you can emulate low speeds but ranges (IMO) are far from practical usage (Nokia e50 is able to control digital camera shutter from 2-3m... with very, very careful aiming). The amount of hacking needed to achieve this is shown here, you basically need to trick IrDA to send correct impulses with correct frequency.
The second thing is that CIR remote control is not as simple as you might think. There are countless standards that differ in used frequency, modulation, wavelength, command codes and so on. You need to know what you want to support. LIRC site can be very helpful in determining that http://lirc.sourceforge.net/remotes/. Approachable explanation of what it all means is available here: http://www.sbprojects.com/knowledge/ir/ir.htm
As for ready made libraries and platforms... I honestly don't know. I've seen it done on PocketPC (nevo among others) and Symbian S60 (irRemote). Haven't seen working J2ME app yet.
Last time I needed the IR remote I hacked it together using IR diode, AVR ATTiny and surprisingly short piece of assembly :)

Resources