How to interoperate between PC and camera from cell phone - java

My new project is to build an application to use the cell phone camera as the main camera from my PC.
How can I do this kind of stuff?
I thought of using bluetooth, but how my PC define the cell phone as the main camera?
Best reguards.

Depending on the camera phone and its features, you can do it. For my Bluetooth efforts, I've been using A7 hardware and a .NET library Blue Tools from Franson.
I've been able to:
pair devices in code
send/push images to the phone (probably the reverse would work, but I didn't try)
discover devices automagically
serial comm
network com
install as a network driver

Well on the Bluetooth side of things you might need a program running on you phone to forward the images. Or you might find that there's a Bluetooth program already running and providing that service, for instance the Bluetooth BASIC IMAGING PROFILE (BIP) (1) profile includes the usage scenario: "Use of a mobile phone to control the shutter of a digital still camera and immediately examine the result on the phone’s screen. In the present scenario, any other portable imaging device could play the role of the mobile phone."
So first you need to find if the phone supports BIP. You could for instance use the SdpBrowser sample application in my 32feet.NET .NET Bluetooth library to see what services the phone is advertising. Otherwise perhaps its documentation will tell you. You'd then have to find out whether the BIP service on your phone supports that scenario.
On the PC side you might need some driver level software to allow any application to use the remote camera. You might start by just allowing your own application alone to use the camera.

Related

Turn on mobile earpiece forcefully

Following is the scenario:
Headphones with mic are connected to a mobile device.
What i want to achieve programmatically:
After a call is been initiated, audio from 3.5mm jack should (forcefully) be routed to mobile earpiece rather then headphone speakers, while the mic should be used of the headphones.
I have searched a lot on google but found methods only to forcefully turn on mobile external speakers.
Reference : how to turn speaker on/off programmatically in android 4.0
While, my goal is to turn on earpiece forcefully.
My research from google:
To achieve this there might be possibilities of system (root) permissions, which a third party application might need.
You may have to write a modified audio driver from sources ? As the functionality is based on the operating system.
If it is possible, can any one guide me on this ?
UPDATE
One more reference: Android - Getting audio to play through earpiece
But the above code does not work on all phones.

Success in using Android to control an external monitor via HDMI

just wondering if anyone has managed physically to use an Android tablet to control an external screen via and HDMI cable. The Android tablet should have the Presentation APIs, so a version > 4.2m and an HDMI (or mini HDMI) port.
https://developer.android.com/reference/android/app/Presentation.html
So far we have tested with a tablet that has Android v5.1.1 and a mini HDMI port, but as soon as we connect the external monitor, the tablet monitor shuts off (but it is still responsive to touch) and all the output goes to the external monitor.
The tablet is a HannsPad Titan2 13.3 inches.
So we are still stuck on the physical setup. It this does not work at least with mirroring, how can we be expected to start tinkering with the presentation API?
So we are looking for confirmation from other coders that the setup is at least physically been done and tested at least once..
Thanks
W
as soon as we connect the external monitor, the tablet monitor shuts off (but it is still responsive to touch) and all the output goes to the external monitor
That was an incompatible and unfortunate choice made by your device manufacturer. The screen should remain on. You might rummage through Settings to see if there is a way to configure this behavior, or contact the device manufacturer for support.
The tablet is a HannsPad Titan2 13.3 inches.
Buy a better brand next time.
It this does not work at least with mirroring, how can we be expected to start tinkering with the presentation API?
Buy a different tablet. Note that (micro-)HDMI connectors seem to be less common, though some tablets might also support MHL or SlimPort.
Or, in Settings > Developer options, choose "Simulate secondary display" to give yourself a floating window that serves as a fake external display that Presentation can drive (except perhaps on Android O). For development purposes, this works for light testing.
So we are looking for confirmation from other coders that the setup is at least physically been done and tested at least once.
I have never used that tablet. However, the Presentation APIs work just fine. For example, I was just updating my CWAC-Presentation library yesterday, and part of that testing included trying my demo app on a Nexus 10 connected to a micro-projector via its micro-HDMI connector.

Connection to HID USB device (keyboard and mouse) in android

I am trying to develop an android app for managing HID devices.
Using UsbManager and getDeviceList() provided from google sdk and following the android sdk official documentation, I am in condition to set up a connection with various devices (as pen drives, external HD, usb "phone" etc.), but I am not in condition to connect the android smartphone to usb mouse and keyboard: they are not listed by getDeviceList() method at all, even if android OS is able to recognize and use it!
In fact, I am using the mouse and the keyboard with the mobile without any problem.
I am using for my test a samsung galaxy S4.
Any one can give me some explanation about this, please?
Thank you!
p.s.: I also tried to use app like "USB Host Diagnostic" and the result is the same: the app can not recognize connected mouse and keyboard...but mouse and keyboard are still working perfectly...
Have you looked at Android Open Access Protocol yet? In the section titled HID Support:
The AOA 2.0 protocol adds four new USB control requests to allow the accessory to act as one or more HID input devices to the Android device. Since HID support is done entirely through control requests on endpoint zero, no new USB interface is needed to provide this support.
HTH.

Looking for options for a cross platform mobile app to communicate with a micro-controller

I have written a Java SE desktop application that communicates with a micro-controller. It displays data received from it and send updates to it, communicating constantly. It uses some third party libraries and the javax.comm library to communicate over serial. We are currently investigating our options for developing a cross platform mobile app that has the same functionality. Ultimately, this new application would be able to be compiled and run from the desktop, a mobile phone and a tablet. I have researched a few options (Oracle's new ADF mobile, phoneGap, Java ME, etc.) but am wondering if anyone has any suggestions of what would be best. Feel free to ask any follow up questions. Thanks in advance.
Ray
You are going to run into a couple challenges in doing this. First of all, any cross-platform framework is almost immediately out. Because of the significant differences outlined below, no framework I'm aware of has support for hardware connectivity.
Hardware
Your embedded device is currently communicating with a PC using RS-232 (UART). This is a hardware interface that is not present on any consumer mobile devices (except the iPhone, but we'll get there). The only common interfaces between all the major devices platforms (iOS, Android, Windows Phone) that support a point to point connection from a hardware perspective are USB and Bluetooth.
Of the two, Bluetooth is the simpler one to adapt onto your embedded device because there are numerous Bluetooth modems on the market that simply attach to a UART and relay data over the link as a wire replacement using the RFCOMM protocol.
SDK Support (i.e. how can an APP talk to this hardware?)
The Android SDK supports communication between an application and both interfaces. Bluetooth came about in Android 2.0, and USB in Android 3.1.
The iOS SDK supports communication with both since iOS 3.0. It also supports Bluetooth LE as of iOS 5.
The Windows Phone 8 SDK claims it will support Bluetooth connections, no word that I know of on USB support.
Licensing
This one really only applies to iOS, but it applies to both Bluetooth and USB/Serial. In order to develop the hardware side of the iOS connection, you must be a member of their Made For iPod program. Membership is free, but requires a significant amount of paperwork, and this really only gets you access to the documentation required to implement the protocols required by their proprietary connector. Obtaining the connectors and other components required to make actual connection require further approvals that are not easy to obtain.
Bluetooth LE is the only connectivity standard on iOS that does not require membership in MFi to implement on both the hardware and software sides. However, to date no other major mobile SDK supports this interface directly (Android is getting there).
Overall, my recommendation would be to lean towards adding Bluetooth and keep a close eye on the Bluetooth LE space. If you can find an embedded module that runs dual mode, you can run LE to iOS devices and standard Bluetooth to other platforms. This is the only license-free path I can think of, and as Bluetooth LE SDK support improves, the other devices can take advantage of that as well.
Based on your tags, I presume "cross-platform" really just means android & iOS? That said, the question which cross-platform tool to chose has been answered quite a few times here, and doesn't really bear repeating. My recommendation is to go native, unless you really don't care about performance and optimal solutions.
That said, the interface to the hardware should be interesting. Android has the Open Accessory Protocol which is compatible with more recent versions of Android. This is for connections over USB. Apple is considerably more closed and requires licensing fees for the protocol, the connectors, etc. Your best bet would be to go with bluetooth or even wifi to interface your hardware to the mobile device. This would require only a single hardware design for both devices and would be somewhat future-proof as well.

Control a desktop application using an android phone

I want to build an application where an android phone would control a desktop application.
I only need to send coordinates from the phone to the desktop when user's finger is on the phone screen.
But I am kinda confused on the networking side if i should use bluetooth, usb, or wifi (intranet).
I did some research on bluetooth, doing bluetooth socket programming on an android phone shouldn't be a problem, but on the desktop side there are only a few free SDK/library. any suggestion on what to use?
If I were to use USB/cable, What API on the android side I need to use?
I am actually more familiar with general socket programming (wifi), but I think it's going to be slow (correct me if Im wrong) so this would be my last option.
PS: I am using Java for the desktop application too
any suggestions on what method to use? or even maybe I should use .net on the desktop side?
Thanks
You might find the open source RemoteDroid app to be useful in creating your app. It may even do everything that you want.
The source code is here. You may need an svn client like TortoiseSVN in order to download it.
Wifi is probably the most supportable.
Bluetooth requires hardware and drivers on the PC side
USB would ordinarily seem like the most sensible if the wire isn't a problem, but the catch is that it requires that the user enable "USB debugging" on the phone, and have either the android SDK or equivalent functionality to the adb forward command installed, plus a compatible USB driver for the phone. If all that were the case, you'd just forward a port from the PC to the phone and have a pc program connect to that port on the loopback interface which will be forwarded to a service running on the phone.
It's possible you could do something piggybacked on the USB tethering capability of more recent releases to get you a network-over-usb that you could use to connect programs on the PC and phone, but you'd need modified PC drivers so that you don't actually push the PC's internet traffic through the phone (unless you mean to tether as well).

Categories

Resources