communication project using android - java

i'm doin my project in 8th sem telecomm engineering, and i'm plannin to create a DUPLEX(not confident whether it'd be full or half) communication app using bluetooth and wifi as channels,something more advanced than a simple walkie talkie, and i was wondering if this is possible for a one man army??? also i was wondering if it is possible to do so with android versions 2.2 and above... can i just program the bluetooth settings in app in such a way, that, it doesn't pop up for user permission to accept a voice message from the calling party??
and is there a possibility for creating multiple channels(one for Forward Voice Channel and one for Reverse Voice Channel) using bluetooth or wifi?? here's a list of few knowledge i possess:
JAVA: basics, done some gui in desktops, know some imp classes,only SE6...
WIRELESS COMMUNICATION: learning it this semester, stuff like how base station accepts incoming mobile station request and redirects it to dest, mostly 1g in our portions...
OPERATING SYSTEMS: general, looking forward to learning android and linux os...
C,C++,DSP,and SOME ELECTRONICS...
oh, and iwoul like to implement these well within 7 months duration...
people please ENLIGTHEN me with your wisdom and references to useful websites ASAP...
my THANKS AND WISHES to thee...:)

The first big problem i see is that on using wifi for this, and as i understood it is some sort of (advanced) walkie-talkie app with no rooter inbetween the communicating phones, you have to implement adhoc-wlan on your android device, which is not supported by android, so you will need a rooted device for that, and the implementation of adhoc-wlan on android is definitve possible (have a look at this code: http://code.google.com/p/android-wifi-tether/) but nothing easy (i have done it myself for an university project).
And you asked if you can avoid the permission pop-up for an incoming message, but on an android phone activating your bluetooth or pairing it with an other device will always ask for permission from the user.
I cant help about the multiple channels you were asking for.
As Answer to your big Question: "is it possible for a one man army?" i would say generelly yes, but it depends on how much other stuff you have to do. Since you were writing this is an project for university, i dont know if this is your only project and you can invest a lot of time in it. If so i guess it is possible, but it will be an quite big project and you should be willing to work yourself relativly deep into networking stuff.
On google.Code you can find some projects similar (at least the wifi part) to what you think about to do, take a look at them...

Related

Is there a way to create keyboard macros through an android app?

First of all, I am extremely new to coding and I just learned the basics of java. I want to do an android app as my first project. The idea of the app would be to have buttons on your phone which would work as keyboard macros. I was wondering if I also needed to create specific windows drivers for it or if I could just make it run on the default windows keyboard drivers? As I said I am super new to all of this (about 10hrs of programming experience), so feel free to correct me and educate me as much as you want! I won't take it personally, I'm looking to learn :)
You would need to set up some sort of communication between the app and your PC. You wouldn't need to do anything with the keyboard drivers. Java has something called the "Robot class" which allows you to simulate a keypress.
Here is the documentation on the robot class: https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html
As for the communications, you will need to create a server/client connection. One of your devices will act as the client (probably your phone) and one will act as the server (probably your PC).
This is just a rough idea of how it would work but:
When you tap the button on your phone, it would send some specified data to your server that is running on your PC. You should set the data that gets sent from the client to the server as the key(s) keycode that you would like it to simulate so it will be easier to implement. When the server gets data from the client, it should send that data to the robot.keypress(data) function.
This honestly sounds like it will be a big project for your skill level but I wish you the best of luck on this. This will probably be a frustrating experience but don't let it get the better of you.

How to communicate with a device?

I am a web programmer and I am just wondering how software and hardware can communicate. I have basic knowledge in Java but I am not an expert.
Let's make it simple. I have a device which is just a simple lamp that can get switched on and off and it is connected via USB. My software has only one function - pressing enter.
By pressing enter I want the software to communicate with the USB port and tell it to activate the device. How would that be possible? Where do I have to start and what do I need to learn?
I understand that my question and my example sound silly but I am just trying to understand how it works.
I appreciate any help!
I think that if you using arduino or other prototyping board you might use rxtx serial library.
If I answer simply, then I should tell, you need to have microcontroller to do this by your own.
A microcontroller is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. So, there are input, output pins for different operations you want to do with your physical hardware and also a memory to store the commands or program. That means a microcontroller is a third party which keeps communication active between the hardware and software in this case.
In the market, you can find many microcontroller integrated boards for building digital devices and interactive objects that can sense and control objects in the physical world.
To make your work easy as a beginner, I suggest you to buy an arduino board from the market. If you google it and search for arduino tutorials in youtube, you will find how they work. Hope these help you.

AVR Microcontroller temp sensor communication over LAN

Hello infinitely more skilled people than me ;-),
I have a question for my Brothers School project and I want to help him.
He has a micro-controller board with a LAN port and wants to attach a temperature Reader to it.
Has anyone a Suggestion on How to communicate this data let's say for example to an Android app that can Display the temperature graph or just the temp at the current Moment?
If not Android he wants to Display it via a Java app on a desktop that displays a temp graph and average temps.
I tried to Google it but I haven't found anything that describes this case. Maybe I don't know how to formulate it.
I know it super vague to describe it but maybe some nice guy can send me code example how it would look like, since I am a total beginner.
Here is the AVR board (it has a LAN port)
http://www.pollin.de/shop/dt/MTQ5OTgxOTk-/Bausaetze_Module/Bausaetze/Bausatz_AVR_NET_IO.html
Thank you :)
Thanks and have a nice day :)
As far as I can see, the board features an ATmega32 controller and an ENC28J60 Ethernet controller (with SPI!).
It seems they provide some sort of server application that communicates with the board (via Ethernet/LAN). The app is not trivial, as I see it also has firmware update feature (so the AVR chip has also a bootloader in its flash).
Anyway, an interesting approach would be to connect your temperature sensor on one analog input, then start the board and the net-server app (connected to LAN). You'll see the related measurements on some ADCx (in Volts).
After that, using Wire-Shark or similar tool, you could spy the communication messages between the board and the server (knowing their IPs, to filter out all other crap lurking on the LAN).
Next step would be to find out the specific message server sends to request the ADCx, and also the related answer from the board. Not trivial, yet doable I guess :)
Finally, knowing what messages are exchanged (I here assume you don't have the specs for the protocol or the source code), you should replicate/implement something similar in your Windows/Android application (further conversion from voltage to °C temperature to be displayed is yet another thing to be done by your app - the easiest part, I suppose :).
With the data you provided, I think this is the best suggestion I can make.
Best luck with your project!
BTW: Best place where you can find help (and source code examples, compilers and related stuff) for AVR is: www.avrfreaks.net
Did you see the software and firmware that comes with the board (download...)?
It pretty much has everything you'd need, i.e. TCP/IP stack, simple command/response server to access digital and analog IOs &c.
See the documentation: https://www.pollin.de/shop/downloads/D810058B.PDF, esp. "Protokollaufbau und Kommandos AVR-NET-IO", e.g. "GETADC 3 (ruft den akt. Wert des ADC-Eingangs 3 ab)"
Hence, you should be able to use the stock firmware and talk to it from your app/whatever via simple commands over TCP. You can query the boards input states and do any calculations on that in the app before displaying the result.
(Edit: You did not state what kind of sensor he wants to use. If the sensor's output is not an analog voltage but some digital protocol, the stock firmware in fact won't get you far.)
The boards firmware is written in C (closed source, I believe), but as I said, you'd probably not have to bother with that. However, if you want, there are alternative firmware versions available as open source from the 'net; and if you're inclined to a greater experience, you can also create your own, possibly building on an available TCP/IP stack and ENC28J60 libraries (readily available too). You could also add a simple HTTP server on top of that &c, &c.
Some links that instantly turned up when I googled for "avr net io firmware":
http://www.fhemwiki.de/wiki/AVR-NET-IO
http://engelhuber.de/blog/2013/10/29/pollin-avr-net-io-mit-e2000-firmware-ueber-php-ansteuern/
http://netio.davideickhoff.de/de/
http://son.ffdf-clan.de/

Controlling your phone from laptop

Idea: create a remote control for your android phone.
Why: I like listening music on my phone in a dock station with speakers connected. Now sometimes I want to turn the volume up/down, change the song, etc. So I need to unlock the phone, locate app that is playing music (Music player, internet radio app, etc.). Sometimes I manage to undock the phone or just mess something up and generally this s*cks.
So I would like to control my phone (on a data connection, not wifi) from the laptop (on wifi).
I had investigated couple of approaches and would like to get some recommendations on them:
Use XMPP. This is nice as there a lots of free XMPP services I can use. Two libraries (both based on smack) that I tried work just fine (Flow aSmack port and Beem smack port). I could automatically create new user on device and present some id/password combination that I (user) would enter on a desktop side to link both devices.
Use JXTA. Should be the next real deal but could be an overkill. I would imagine running a rendezvous&relay server somewhere (need to get hosting to work around firewall/NAT) and creating a peer group protected with password. Use device unique id and password (withing group) to link to the desktop application. (A great eBook explaining p2p and JXTA can be downloaded from here).
Use C2DM. Could be the answer, but notification delivery sometimes can take more then couple of seconds to deliver and there would be no feedback mechanism.
So far first solutions looks like a lot easier choice. Create custom extension or just create chat between both endpoints and use that for relaying commands/messages. But I wonder if I would be abusing XMPP system?
JXTA sounds great, but from all the reading I done it is apparent that it is designed for group communication and service sharing and not a solution for connecting two endpoints.
What do you guys think? I welcome all suggestions too.
UPDATE I do not want to remote to a phone and interactively control it. I want to establish a connection (socket connection) between laptop and phone even if both of them are on different networks secured behind firewalls, routers. With this I could define a protocol to issue commands to the phone (lower volume, mute, start app, etc.).
UPDATE 2 I'm giving JXTA a shot. It is a nice solution but lack of documentation is a bit of a downer. Got VPS FreeBSD server to test RDV/relay side of things. I keep updating this question further as it may be helpful for others.
UPDATE 3 Some more reading:
How to make two android devices to communicate through TCP
Connection between two computers without opening ports using a third computer
UPDATE 4
So far I did not have enough time to further continue my project. I did find an interesting project. At the moment project owners are re-writing their library, you can track their progress here.
why do not you try installing VNC server on machine and then use VNC client on laptop to access mobile
Mobile Shell (Mosh) maybe just the tool you are looking for. I have been looking for a good project to use Mosh, your idea seems pretty interesting :)

Device to Device Communication in Android

I have been tasked for university to program a mobile phone application. I have oppted for two mobiles to communicate with each other via message.
I would like the application to connect the mobile to the internet to send the message and the other mobile to connect to the internet to recieve the message.
I am using Eclipse IDE.
Does anyone have any ideas for good examples of similar application source code so I can develop my application using appropriate protocols.
I would appreciate any advice and I am certainly not looking for someone to give me "the answer" I am really looking forward to getting stuck in. Though I have never touched an android phone let alone programed one. So some advice would be amazing!!
Thanks
Si
Get used to this site: http://developer.android.com/index.html Learn it, love it. It's full of useful information. The Videos section gives plenty of live talks about what exactly Android is among other topics. One of the first things you need to do is go to the SDK section. It gives a detailed guide on how to get setup. The Dev Guide is great for learning more about Android and how to program Android apps (not just Java programs) especially while just getting started. Resources is full of code examples and articles on specific issues and Reference is the entire platform documentation. #Matthew Willis has already given a helpful link from the Dev Guide.
Look around the site, download and install the SDK, and come back whenever you have any questions. Good Luck!
Before you determine the technical solution you need to figure out how any two devices that don't know about each other will communicate.
In your case, where you seem to be attempting to develop some kind of peer-to-peer solution you most probably will need some kind of server in between where your phones send messages to and poll for messages.
If you are using WIFI, you would have each phones IP address and could configure each phone to communicate with each other directly.
Once you determine your architecture then something simple like http may be enough to communicate.
You might check out What is Android? to get an idea of the frameworks/libraries that are available on Android. Reading the links in the left pane at that site lead you through a nice series of articles about Android.
In terms of ways for two devices to communicate, they are many and difficult to enumerate. In general you will have much better luck with specific questions here than you will with broad questions.
You might be interested in reading about C2DM for pushing messages to a device; if not, there are many other alternatives involving polling.
GCM CSS is probably your best bet
https://developer.android.com/google/gcm/ccs.html

Categories

Resources