I have searched for way to make real-time voice (calls) between two peers but only found how to record voices and send them or sending photos and text. but what I want is for the two peers to be able to call each other. So is it possible that using WiFi P2P manager on android would allow me to create a real-time conversation between the two peers? Does android have that feature?
Wifi p2p is now called as Wifi Direct you can connect with WifiDirect to transfer files between two or more devices you can find the WifiDirect demo project on android developer site
And if you want to work with SIP you must have a valid sip account some site allows free sip account one of them is can be Found here after having a valid sip account you can start calling over wifi and you can download one more open source project sipdroid from Here
Am sure #Ibrahim wants to be able to connect the two android users without a dependency on internet. Using the internet is the 'old' style. Meanwhile do check this library :
https://github.com/fyhertz/libstreaming
There is so much resources here that we are learning from in building connectivity for users here in Africa at large without the need for internet.
Related
A similar question was asked How to send data from one android device to another?
However their scope of data pass is between android devices.
And so to extend that question, I wanted to know ways of connecting two completely separate devices like ECG device to apps (Android or IOS).
For example, AliveCor allows to send reading of external device to their mobile app.
So what ways do we have apart from Bluetooth or TCP/IP?
You have essentially listed all reasonable means that are used nowadays. You can either transfer data via bluetooth, using your own/3rd party hosted webservices like firebase or direct tcp/ip connection. TCP/IP probably being the hardest, bluetooth being 2nd hardest and webservice being the easiest but yet requiring both devices to be online. The implementation is however totally your responsibility (with web you would either add user registration and sync user data to all signed in devices, or if sync is one time thing, you could upload data to your server, issue a expiring token, which if entered in other device allow it to download that data).
Another way is NFC(Near field communication). You can transmit data when phone(with NFC) is near to another device (with NFC). Also,
For example, AliveCor allows to send reading of external device to their mobile app.
this app use NFC for transmitting data.
From permissions ( google play AliveCor Kardia app)
Also read the information about this system on https://www.alivecor.com/faq/
https://books.google.com.ua/books?id=H-JRAwAAQBAJ&lpg=PA41&ots=EV9Qy61sjY&dq=nfc%20data%20transfer%20ECG&hl=uk&pg=PA41#v=onepage&q=nfc%20data%20transfer%20ECG&f=false
I want to off mobile data for some specific apps,what I want is that if my mobile data is on then I can allow only whatsapp to access,no other app. I know its possible because some apps for same are available on google play but I am not getting any code for the same. I have googled a lot.Any help is appreciated.
Go to Settings > Data usage then you can see app usage and select each app and turn on restrict app background data.
You can make a VPN application. Within the application you can make a list which apps allowed to access internet and which apps not to allow it. Make sure the connection is through that VPN application. Then filter the connection in your VPN based on the lists
You can use VPN, build your own server and transmit all the traffic through that server, than you can filter all the traffic.
Maybe you can google "OpenVpn" or "ToyVPN" in android's sdk for some ref.
my new task is to implement Voice/Video chat native application in Android. I browsed net for the same and it was written that using Android "SIP" API we can do it. I gone through the documents about SIP.In Implementing using SIP we required SIP address for each user which will be provided by different SIP providers. I also checked the SipDemo sample app provided in samples.
Problem is my app will be used by many Users and they can chat with any others.
So, how can we generate SIP address for each user dynamically and establish communication session ?
or each there any other way of doing this ?
Please Help
If you want to test your android app you can generate a free sip account from AntiSip.
and for generating sip account dynamically you have to configure sip on your server with the help of Asterisk:
Two VoIP software can contact each other directly by using direct SIP URI like username#IP:port.
This can work fine on local networks where the UA (sip user agent) has fix address. Otherwise you will need to use a SIP server (This is the main role of a SIP registrar server: to keep a track of the user locations). There are plenty open source software for this like the above mentioned Asterisk but you can also find a lot of services offering free calls (free from softphone to softphone; they charge only if you wish to make outbound calls to landline or mobile numbers).
I need to implement a simple messaging functionality in my app . Two users who have installed my app should be able to message each other inside/outside my app . It doesnt need to be real time like a chat app. A bit of latency is acceptable . Should I implement this using a central server and a Google Cloud Messaging service like UrbanAirPush ? Or Should I use socket programming(not very familiar with this ,but I dont mind learning) .
Also , I dont want to use SMS or bluetooth for this . Please advise me on the correct approach to this . UrbanAirpush has a limit , So any other option would be wonderful .
You can create a free web service in cross-copy
You can use this api as a guide
or just Google it.
Use wifi direct or Network service discovery.
Use wifip2p can allow you easily send message/audio/picture to other device nearby, you can check this tutorial: WIFI DIRECT, the NSD is also list there. You can even find sample codes(WIFIServiceDiscoveryActivty) from Android SDK to check some more information.
I'm using C2DM in my Application to send data from mobile to mobile
But C2DM uses Google server(lacks data confidentiality) to redirect messages to device.
Is there any other way for sending data from mobile to mobile directly without any third party server?
I dont want to use SMS in my App.
Base on requirement (1) Without third party server (2) Between 2 mobiles.
Your options are limited to these:
WiFi Direct (Ad Hoc Network)
http://developer.android.com/guide/topics/wireless/wifip2p.html
Bluetooth
http://developer.android.com/guide/topics/wireless/bluetooth.html
NFC
http://developer.android.com/guide/topics/nfc/index.html
You clearly said "no third party server". But may I suggest xmpp. I've had good luck with smack derived jars and OpenFire. You get a lot of flexible and easy to use functionality out of the box. It may be your best bet for chat type applications.
We host our own instance of OpenFire and authenticate against Active Directory. The XMPP protocol provides the user/device addressing, routing, and, optionally, store and forward capabilities.
It also makes it easy to exchange device data with applications written for other operating systems and in other languages. XMPP IQ packets can be used for lookup type transactions without the overhead of a Chat type connection (no presence information, back end XEP-114 plug ins to connect with server side resources).
Not really: your device has to know which device to connect to. You could theoretically do that if you know the IP of the device, but with mobile phones this changes frequently and I'm not even sure if mobile providers will let you connect directly to devices on their network. So, you're at least going to need a 'step' in between the two phones that you can trust to be stable.
What you could do is set up your own server, and let a user (user1) upload messages to your server addressed to a specific sender (user2). When the message is received, you can use C2DM to send a signal to user2's phone, and attach the message's unique identifier to this. When user2's app receives this message, you can proceed to download the message content from your webserver.
If you don't want to use any webserver at all, you're limited to the options mentioned by Calvin: WiFi, bluetooth or NFC.
Unfortunately having a direct socket connection between mobiles phones is almost impossible as they invariably are behind firewall. BTW also look at https://www.alljoyn.org/ Its an interesting technology as well.