Unable to understand the concept of server for chat in android - android

Since I am new to android I am confused with the concept of server for android app. After going through different tutorials I landed up at openfire server. I have done with setting up the server on my computer. If I turn off my computer the server will be closed and app will stop working I guess. How the real time chatting app work. How to get a real time server which will be available to the user 24/7. Please help me get rid off it.

Seems like you have setup server on your local machine. This requires your system to be turned on always. Try hosting it in a third party environment. Hope this helps!

Related

Android calling API from my app very slow using cellular network

We have very strange issue.
We are using godaddy domain and google cloud for hosting.
We have App on Android and iOS everything seems working fine.
But Android app taking 40 second to call API. As server log showing request served in 100ms.
This happens with particular when we are on cellular data. All other websites loading fast.
Issue happen Android app + Idea cellular only.
When we hit same API URL on mobile browser it works normal. But in app it takes 40sec to 4 min to get response.
In ios app we are not facing this issue with idea cellular network.
We are unable to debug this issue.
Thanks in advance..
check if the cellular is consuming any proxy. if so disable it and try again. if the problem persists then use cloud flare or google DNS. I hope it will help you out.

Sending Requests to Locally-hosted OpenSips Server using android

I am really new to opensips and lately I was able to install the OpenSip server on my VirtualBox based VM ( Debian 10). Now I want to create an android application which enables SIP calling (Push to talk app) using that locally hosted OpenSip server.
I tried to understand the documentation on the OpenSips, but it is really tough for me. For now, to make sure that my OpenSip server is finely running and handling the SIP calls, can you suggest me a way to test it using an android programme?
Thank you!
Try Linphone - it's an Android based SIP User Agent.

Best way to implement a connection between a smartphone and a webpage on a pc

I am looking for an existing library to establish a connection between any smartphone(android/ios/win phone) and a web page.
Sort of what whatsapp is using (https://web.whatsapp.com/), with authentication.
Once the connection is established, i will have to send real time data ( audio and text) from the phone to the pc.
I suppose that whatsApp use a server to relay the data. i dont mind doing the authentication with the help of a server but once the connection is ok,I prefer to do all the communication on wifi instead of sending data from the phone to a server and sending it back to the web page on the pc.
Thanks!
When you want to solve a particular problem which is already solved, You don't want to reinvent the wheel(especially in web) but use the existing solution.
What you are looking for is WebRTC. Fits exactly for your use case. But i am not sure about the development efforts required for this.
There are Client libraries in almost all languages. A quick search gave this for Android
And i am not sure about the device support you are expecting, check Caniuse?
Also have a look at WiFi-p2p for android.
UPDATE:
check this webrtc website for cross platform development support and examples.
There is no real "best" way of doing this, but you have to have a server of some type running on your computer. From there you can use normal network requests from Android to communicate with your computer as long as they are on the same network (WiFi). https://developer.android.com/training/basics/network-ops/connecting.html

Socket.IO Client fail to connect to Socket.IO nodejs server after latest Openshift update

I have a nodejs v0.10 server with socket.io (v0.9.16) running on Openshift, for the past 2 months it has no problem receiving data from my Android apps connecting to the server using AndroidAsync (https://github.com/koush/AndroidAsync). Suddenly after Openshift upgrade its service on 25th Feb the Android app fail to connect to the server. Every time the app tries to connect the server, the server will output an error, I run Socket.IO in debug mode and this appear (debug: destroying non-socket.io upgrade).
Funny thing is, the same server also host my web client running the same socket.io library, and it has no problem whatsoever with the web client. Can someone please point me to the right direction? I am connecting to the server with http://www.xxxxxx.com:8000/ where 8000 is the websocket port given by Openshift.
I read that "destroying non-socket.io upgrade" might due to invalid/incompatible socket.io js file, I tried to do a manual check on the socket.io file by typing this in my browser
http://www.xxxxxx.com:8000/socket.io/1/
I got this return code:
An-vI1BJofr45j9c_GmH:60:60:websocket,htmlfile,xhr-polling,jsonp-polling
PS: My Android code hasn't been changed, and so is my server code.
PPS: I have successfully connect in localhost environment and my own server. So the problem is most probably originated from Openshift, not sure what have been updated to break it.
All of a sudden it works again without any code changes. I would however recommended anyone using my approach of connecting to backend server to have a http push backup just incase any future server updates breaks it again.
Would appreciate if anyone from Openshift can help clarify this to prevent sudden death on running production apps. Thanks.
Make sure to check OpenShift Online's system status page to see if your apps have been impacted by a system outage. (fyi: we run on top of AWS)
I would definitely consider using one of OpenShift Online's paid hosting plans for production quality applications. Apps that are created using paid plans go onto a separate array of machines (more resources), and are configured to be more highly-available (no sleeping due to inactivity).
Hope this helps answer your question. Please close if so.

Remote wipe data using Device Administrator Application+ android

I am working on android device policies, i am able to implement wipe data, force lock using sample given at below link
http://developer.android.com/guide/topics/admin/device-admin.html. I am not able understand how to wipe, force lock, change pwd Remotly from server. I spent lot of time in searching to get information but i am not suceed. Please give any information to implement policies Remotely.
Thanks in advance.
I've googled around a bit today as well, and I've come up with the following solution:
First, write a device administrator app, like the one referenced in the link you provided.
Then you will have to implement some technique so that you can push messages from a server to the android client. As of Android 2.2, you can use C2DM (Cloud to device messaging) provided by Google, I guess it isn't to hard to configure and get going. If you do not want to use this, there is the option to use some other kind of messaging framework, that allows you to push data, like XMPP or MQTT. The facebook messenger app for iOS uses MQTT, so that can't be all bad. It will however require more work setting up, than C2DM for example.
Finally you will have to push some kind of message from your server to the client via the method you chose and let your device administrator app listen to these messages and respond with the correct action, depending on message. So you can decide on your own what the messages will look like and contain.
There is also the option of using Exchange, but I do not know how that works.
So that is basically what I found out from my little research, I'd love to hear other ideas from someone else as well.

Categories

Resources