I have configured openfire server on my laptop running windows7. Pandion and Spark desktop clients are working fine on the localhost. Tested it thoroughly with multiple users.
Laptop is connected to a wifi network.
I am trying to connect to the localhost openfire from Xabber client installed on Samsung galaxy pop running Android OS. Mobile is connected to the same wifi network.
http://localhost:9090/login.jsp?url=%2Findex.jsp
I am able to access this admin url in mobile browser.
But none of the xmpp clients are able to connect to localhost openfire.
Configuration done-
server- localhost
port- 5222
username and password are exactly same as provided in Spark desktop client.
It would be great to know if someone has the solution.
Thanks.
You cannot use localhost in the android client to connect to your laptop. And i do not believe that using localhost in an android browser would connect to a server on your laptop. You have to use the local ip address of the server to connect. Often something like 192.168.#.#.
Related
How to get https on the localhost on my mobile device? When I start my .NET Core project on my PC there is https://localhost. But when I try to connect to localhost following these instructions: Access ASP.NET Core 2.1 web app hosted on localhost from mobile device what I get is HTTP. Is generating and installing SSL certificate on IP address the only solution? Or maybe there is another way to check how push messages look like on mobile device?
i have an Android app that needs to access offline a MySQL database that's hosted on my localhost (i'm using WampServer).
i can't use USB tethering or port forwarding because my laptop won't have internet connection too.
what can i do?
You can setup wifi, connect your system which contains server and your android device to same wifi. Assign a static IP to your server system and let your android connect to that server's MySql through the IP you assigned. Basically it is nothing much different then your web api and db hosted on cloud server and your android application connect to that cloud using either the domain or ip.
I want to learn client - server communication in Android. As per my understating, to communicate with the server we need a valid URL. My doubt is that, can I communicate Android mobile client with the local xammp server???? If yes, please explain me...
Thanks in advance...
yes you can do that if you are using android emulator then use http://10.0.2.2 ip address to access localhost, for genymotion use this http://10.0.3.2.
You can also use Google Chrome's port forwarding but you need google chrome on computer and emulator or device.
if you want to access localhost using port forwarding then open following address on google chrome chrome://inspect and enable port forwarding and set port and ip address.
I am building a simple client server application on which both client and server will connect to an access point, lets assume d-link router, and after successful connection client should be able to send a message and server should be able to show it on the screen. So, can anybody give me some ideas about how should I implement this idea?
You can implement this using XMPP. Extensible Messaging and Presence Protocol (XMPP) is a communications protocol for message-oriented middleware based on XML.
For your implementation, you can setup an XMPP server like openfire. You can find a tutorial to setup openfire here. To write your clients you can use the smack API (for java clients) and asmack API (for android). A sample asmack based XMPP android client can be found here. Install this application in your android phones and you can communicate between the phones(send instant messages) using the same. You can also download spark client to test your application.
I have two apps, Server and Client
I installed server app on Mobile1 and client on Mobile2.
Mobile1 has mobile hotspot on. Mobile 2 is connected to MObile1 hotspot.
Mobile1 ip address is 100.109.213.12 and Mobile2 ip address is 192.168.43.33
I used this code: https://www.tutorialspoint.com/how-to-send-data-through-wifi-in-android-programmatically
Connection happens but data transfer is not working.
I couldn't change ip address of phone with mobile hotspot on but for Mobile2, I was able to change wifi to static ip but after that even client is not getting connected to server, which was working earlier.
Can I do data transfer by switching mobile hotspot on one phone and connecting another phone as client to the hotspot and then running client and server apps on these two phones. I am not going to use any 3rd device such as a router.
I'm designing an android app that communicates with a web server. Till now i was hosting the server on my localhost and was accessing it with 10.0.2.2 on the emulator. Now I need to access a server hosted on the company's network PC vserver36 with address 192.168.1.124. How do I do this on the emulator?
You have just to use the address 192.168.1.124 instead of 10.0.2.2 ;)