I am developing an application. In which the idea is like - i want to connect two devices as two mobile or two tabs or mobile to tab or mobile to server or tab to server. Means i want to send data from one device to other device mostly xml.
I want to connect two devices with out internet and blue tooth, I want to connect them with wifi having no internet. And than want to transfer data.
My point is i am having an application which is used to generate a xml and after generation of xml i want to send it to other device or tab or desktop server on a button click.
I searched on Google and found Ad-hoc network, but it is quite difficult to understand me. Is any other way by which i can easily understand Ad-hoc or other way by which i can connect.
So please guide me what should i do, how can I achieve my task. I need your guidance and suggestions.
Socket connection would be a great idea in your situation, you dont need to have Internet to do so. Here is one of many examples if you google it: http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/
Hope this helps
You can use iJetty. iJetty can be configured to use in your application and when you start wifi router on one android device another can get connected on that device and if it's your client applciation you can configure it to look on a specific port.
Try this : http://puregeekjoy.blogspot.in/2011/06/running-embedded-jetty-in-android-app.html
You could use Wi-Fi Direct if your version of Android is 4.0 or later and your hardware works with it.
Related
I wanted to know if WiFi P2P android API is ideal for use if we take lot of connections into consideration, tha app's users can be at time clients and servers they can share files and send messages and get them also as clients ? if no what is the best solution ( N.B : i'm opened to client/server architecture ).
I just wanted to know the limits of the API cited above and Thank you guys ...
Wifi direct as a technology is ideal for peer to peer communication.However talking about wifi direct for android , it works well only for a single connection that is only 1-1 use case .It is possible to create a one to many where every device connects to the group owner (Soft AP).But even if u build a one to one and try extend to multi use case you will have problems with certain devices that do no connect perfectly.
Checkout some of the problems listed under problems after downloading this application https://play.google.com/store/apps/details?id=com.budius.WiFiShoot&hl=en
If you want to go for multiple connection it is better to use hotspot .One device ends up being the hotspot and other clients connect to the hotspot .It is being used by plenty of application like xender, zapiya.
I am creating a multiplayer android game as a part of my coursework. This is my first game. I intended to allow users to connect to the game over a simple network. I don't want to use internet at all hence I wont be using the android game services. How do I go about this. I have no clue at all. I have tried various tutorials but all of them are using a central game server. I just want to create a simple Client - Server network. One user will host a game and others will join.
it's my first time answering a question here. I usually just read here in stackoverflow. I'm also currently working on my first game. It connects devices using wifi peer-to-peer or WifiDirect (without a wifi hotspot). It requires high version of android OS (4.0 or 4.1?) but I believe you can also try the other way on which the devices needs to connect in the same wifi hotspot for lower OS version requirements. The latter, I haven't tried yet.
After I connect the devices on the same network (peer-to-peer), I use sockets to exchange data between them. I use serializable objects for sending data. I don't know if it's the best way but it works for me.
My game can connect more than two players in wifi peer-to-peer. One device acts as the network owner (and also the game server).
See android's tutorial/documentation for WifiDirect connection :
http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
Be sure to read also the adjacent lessons.
Also, Sockets must be used with Threads so you also need to read about it if haven't.
Hope I helped ^^
I finally got the solution and made the Android application. Simply used java socket programming. It works on Hotspot. This works on client - server framework.
Please find the code here and contact me if you require any assistance.
https://github.com/rohitramkumar308/GameOfCards
and this is the link to the app
https://play.google.com/store/apps/details?id=srk.syracuse.gameofcards
Hope this helps you.
I want to build an app but first I need to know about all ways that are possible to make a connection with two android devices. Over 3G, Bluetooth, Wi-Fi and etc, where can I get a list of this? (If it exists)
To be more clear, I want the better way to find an X device with my Y device and trade some information between them. It`s important to considerate that two devices need to be close each other.
Like the feature of change Friend Codes with friends on 3DS via LOCAL, got it?
Can anyone help me out with this? Thanks already.
If you want to establish a local connection, the following ways can be used.
Internet (Wifi, 4g, etc.). A webserver should be running and establish a secure connection between the 2 devices.
Bluetooth - An app can be written to establish a local connection to a friend who is running the same app.
NFC - An app can be written to establish a local connection to a friend who is running the same app.
I want to send files between two devices using internet connection with out use any intermediate /server. For example there are two device A and B both have internet connection and both device have installed my application, now need to send a file from Device A to Device B. Device A can know all the detail about the Device B.
Is this possible means guide me in the correct way. Thanks in advance.
You can use a Peer to Peer architecture to achieve this. Basically every phone is a client and a server the same time. See here for a basic implementation.
If the internet is not a prerequisite, you can follow Minav Patel's suggestion and use the Android Bluetooth implementation.
Another solution would be the WiFi-Direct feature (if the phone support it). See here for an example.
You can implement file transfer between two android devices using android bluetooth implementation.Go through following links it will help
android bluetooth implementation basics
http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html
http://developer.android.com/guide/topics/connectivity/bluetooth.html
I have a small project I am working on and one of the technical problems I am running into is finding a easy way to get one app on one android device to push data to another app on another android device via lan.
I do not want to have to resort to the push API or other similar solutions in case there is no Internet connection.
I was wondering if anyone had any suggestions for this.
Thanks.
You could definitely use Java Sockets. Open a ServerSocket on one device and connect to it using a socket on the other device. You can then send and receive whatever data you want.