Openfire VOIP Client, How To Use Media Proxy - java

I recently developed an VOIP app on android device. But it lacks of acrossing wlan capability. One UDP connection was established between two client phone in the same lan. The two phone client was communicated via its ipv4 address directly. But now I'm wandering that how could they talk to each other over the wlan? They maybe stay behind the firewall. I was talked that Openfire has the Media Proxy functionality which could be the agent to transfer data. But I cannot find any example of this feature. Could you please give me any advice? Thanks very much. Sincerely.

I assume you have implemented a Jingle client. In order to make this work you should make sure that:
Openfire (acting as a Media Proxy as well) is running on a computer with a
public IP, so that each client behind any NAT can "talk" to it
Your client media engine does support symmetric RTP
To enable Media Proxy in Openfire is simple as going to Openfire server web console (usually at openfirehost:9090/index.jsp), select tab "Media Services", set the option "Enabled" at "Media Proxy Settings" and then click on "Save Settings".
PS: My Openfire version is 3.9.1

Related

biometric authentication java aplication. how to build the connection between an smartphone and application

I have to develop an biometric authentication application.
The application will be written in java and it will be an desktop app, I want to use my smartphone for the fingerprint sensor, but I don`t know how to build this connection betwenn application and phone.
The main application will be installed on a computer without web.
I would be grateful if you have any idea or examples how to do this. Thank you!
You should have an app on your smartphone which uses the fingerprint authentication API.
If you are looking to use an android phone, you can refer this
https://developer.android.com/about/versions/marshmallow/android-6.0#fingerprint-authentication
You can create a simple APP using this API.
When user authenticates, then you can send message to your desktop java application from this App.
By 'without web' if you mean without internet, but can be connected to a local network, then you can send message via TCP/UDP.
Or if you wont be able to connect to any network, then you can try bluetooth.
If bluetooth is also not available, then you can connect your phone to your computer via a USB cable and communicate using Serial communication. There are a few external libraries available for this.

How can an Android application function as a remote controller to a desktop application? (Spotify)

I am in the planning stages of developing an Android application to control my Spotify player. Since I am running Debian on my system, the options that are available on the Play Store are quite limited (I can't find any functioning apps). Therefore, the programmer inside me tells me to build one. I haven't built an Android application before, but I have good experience with working with APIs so I think this could be a pretty decent starter project for me.
However, I am having some difficulties grasping some of the concepts on how I could implement this. With some research of the Spotify API documentation, I believe the Spotify Apps API is the one I should be using to control playback on the desktop.
On the Android side of things, I would imagine I would use the Spotify Apps API in conjunction with the Libspotify API to receive metadata and display what the application is getting from the desktop playback.
What I am having troubles understanding is how does the Android application talk with the Spotify desktop client? I have a few ideas, but I am unsure...
My thought process so far is as follows:
have a local webserver on the desktop open up and begin listening
on the Android application, connect to the desktop's webserver (how do you do this?)
once connected, the desktop sends metadata/other information to populate the Android application
from the Android UI, hitting a UI button will send a request to the webserver, where it parses the data, completes an action, and then returns the response to the Android application
I am a little lost on what tools I need to learn and use to get this working. Any suggestions to the implementation are greatly appreciated!
Thank you!
Your approach is correct.
On host (desktop), open a socket and listen on port 80 (or another port if you wish) and listen. It doesn't need to be a full web server.
On client (Android), to start with send an http request to the desktop' ip address. Desktop responds with a simple web page.
That's how you get the two communicating.
Then you can start POSTing data to the desktop and returning data in the web page.
Then you can move to communicating using JSON rather than web pages.
You can program both the host and client using Qt. You can develop both on the desktop and move the client to Android (or iPad) when you have got it working.
Yes, you are on the right track. If you know java then you can use Java Sockets to connect android and desktop. It should work on Debian. On the server side, you need to create a socket on specified port.
ServerSocket serverSocket = new ServerSocket(PORT);
Then wait for a client to connect
Socket clientSocket = serverSocket.accept();
On the client side, create a socket and connect to the server using IP and port
InetAddress serverAddr = InetAddress.getByName(“SERVER_IP”);
Socket socket = new Socket(serverAddr, PORT);
You can control a lot of things on your desktop using java.awt.Robot class. It let's you simulate keyboard and mouse events. So if you have some hotkeys enabled for Spotify then you don't need Spotify APIs to control it. Just simulate keyboard event. So if spacebar is a hotkey for play/pause then run this on server
robot.keyPress(KeyEvent.VK_SPACE);
This article explains this complete process by creating a simple remote control for vlc

Connecting to my Home Server using socket programming

I'm writing an Android app for home automation wherein the app connects to my home PC via sockets so that I can control various home appliances on the move. My question is how do I make my home dynamic IP static and accessible to other devices on the internet so that I can make this connection. Thanks! :)
Try a free dynamic DNS service such as No-IP. The basic idea is that you install an application on your server that keeps your IP address up-to-date on No-IP, so they can maintain a DNS record that points to your server. It'll give you a subdomain, not a second-level domain, but that should be Good Enough.

Connect to VPN from BlackBerry

Is there any way to create a connection to a virtual private network using the BlackBerry APIs?
My understanding is that to connect to a VPN on BlackBerry you need to use bes, create a vpn profile, and so on. I am looking for a pure app-driven alternative.
Is it possible to do this by using something from the BBOS 5.0 packages or something else?
Here is the answer in case someone needs it:
There is no API which allows you to create/configure VPN profile. AFAIK if you are in the BES infrastructure it is possible profiles to be created on the server side from administrator and then pushed to clients via Blackberry Push Services. I haven't tried it though!
However you can also configure a VPN profile on your blackberry device and set it to a wi-fi connection. Then the Wi-Fi connection automatically goes into VPN as well as all the data you transfer in your app(make sure not to forget to add ;interface=wifi when you call Connector#open())

Server on windows, clients on android

I am now trying to do a project which is, there will be a server on windows pc and there are some clients on android devices.The point is the server one should control the android devices.For example it choose a image or video, send them to the clients and the clients play or show them.Remember the clients should be control by the server.
So could anyone tell me a proper way to do that, which protocol should i use, how do i send the files to the clients and how do the clients react? I am thinking of using java for the server and of course the client will use android application.
Thank you.
You might find Cloud to Device Messaging (c2dm) useful: http://code.google.com/android/c2dm/index.html
In essence, c2dm allows a remote server to send an Intent to an Android app. The device-side app can then respond to that intent to take the requested action. Chrome2phone works this way to open web links on a target device. http://code.google.com/p/chrometophone/

Categories

Resources