I'm trying to implement Google Cloud Messaging for my app in development. I'm following the walkthrough located in the readme a this github repository (the official Google sample project). I'm doing everything that's asked, but I'm confused as to how to test this. As far as I know I have the backend running from my computer (I can connect to the backend from localhost:8080 in chrome), but I want to test device registration with an external device (Samsung Galaxy S4). I realize that the device cannot try to connect to 10.0.2.2 because that makes the device think it's connecting to localhost on the phone itself. I tried entering my computer's IP address with both ports 8080 and 80, but the request times out before anything happens. I'm fairly certain I have the correct Server API Key and Sender ID.
Is there anything which might be wrong here? How can I connect to my computer from the phone? I'm willing to post code and/or error logs if needed. Running LinuxMint 17.2 x64.
if you are on same network , just type the internal ip address of the computer followed by port number , you can test it in the browser itself in phone
Fro GCm Testing you not require to do more thing only get your device token and get you project Auth API key from google developer console test using some tool like ,https://gcm.codeplex.com/
and you can copy your device token using edittext,textview or other thing,
Related
I am having trouble debugging the Xamarin Sports Sample locally on my development machine, so I can debug both the mobile app and the services on the same machine.
I have got the solutions open in Visual Studio 2015. I created my Google API Credentials and updated the settings with that info. I set the Azure domain to my local IP address (also tried localhost and a fake domain name). I added the authorized javascript origins and redirect URI's into the Google interface with the various combinations of IP, localhost and fake domain name.
It looks like the redirect URI cannot be an IP address. I have tried putting the fake domain name into my hosts file. I can run the services solution and it displays in the browser properly. I can hit /login/google in the browser and it looks like it works.
When I run the mobile solution in the emulator and click the login button, I get errors. During my troubleshooting, I have seen various errors, like name not resolved and a few others. I suspected that I could modify the device emulators hosts file to include the fake domain name, but I am not able to get the file system to be read-write, even after trying adb remount. That command says it was successful, but the adb push tells me the file is read-only.
I am using a Nexus 6 API 23 virtual device, if that matters.
Has anyone managed to get this sample to debug both mobile and services locally? Any suggestions on how I can modify the hosts file to see if that works? Any other thoughts on getting this to all run locally?
I have not tried running the iOS project, yet. Will that run into the same challenges?
Your device/emulator probably doesnt´t have access to your server machine.
Check your server local host ip, and run this with PowerShell as administrator:
netsh http add urlacl url=http://192.168.X.X:XXXX/ user=everyone
Replace the ip:port with your host ip and the app port.
Then create a new <Binding> in your applicationhost.config pointing to the above ip:port.
More details (and possible duplicate) here:
How to call your own ASP.NET MVC project preaent on same machine from xamrin webview
I read all the threads about this topic and the instructions for setting up charles with genymotion are all the same:
http://rexstjohn.com/using-genymotion-charles-proxy/
In your Genymotion Android emulator…
Settings -> Wifi -> Press and hold your active network
Select “Modify Network”
Select “Show Advanced Options”
Select “Proxy Settings -> Manual”
Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
Set your Port to: 8888
Press Save
My set up is:
A localhost development Spring server running on my Mac OS
An android app installed on my genymotion emulator. The genymotion emulator communicates with my local dev server through ip 10.0.3.2 (How to access localhost from a Genymotion android emulator?)
I'm not sure if the instructions are old but the issue I'm having is that traffic that flows from my genymotion emulator is recorded within Charles Proxy but it is just not reaching my localhost server. I'm not using any SSL encryption between my server and my app.
This is my settings inside genymotion wifi screen:
This is what my Charles Proxy looks like - you can see that it is "Connecting to remote host". It connects forever and then eventually ends up giving me a 503 error on my android app side with nothing being returned:
If I switch off Charles Proxy, the app connects with my localhost server with no problems and all calls are returned successfully. I think it is something to do with Charles that is stopping my app from communicating with my localhost server.
In Postman, if I try to query the same url that my android app was trying to query, it works successfully and the results are also successfully logged within Charles:
http://localhost:8443/ + my api endpoint **OR** http://localhost.charlesproxy.com:8443/ + my api endpoint
The only difference between querying in Postman and querying in my android app is that my app hits this url 10.0.3.2 instead because I'm working off an emulator:
http://10.0.3.2:8443/ + my api endpoint
I have also added 10.0.3.2 into my Access Control Settings:
I can go into my android genymotion emulator internet browser and search for websites like www.msn.com and it will return successfully plus log the results within Charles but I'm not looking for or are prepared to pay 50 USD for a tool to record my android browser traffic. I need it to work with my android app so that I can debug my app. I'm not sure how to fix this, does anyone here know if I'm missing something?
EDIT:
In case someone is wondering, I have read this post on Charles' FAQ about Localhost traffic doesn't appear in Charles:
https://www.charlesproxy.com/documentation/faqs/
But it is not like I can change the 10.0.3.2 used by Genymotion to http://localhost.charlesproxy.com/ instead so I don't think that would solve my issue.
So I was playing around with the Genymotion emulator and Charles now and I actually managed to get Charles to record localhost traffic.
Similar to the way I queried through Postman with:
http://localhost.charlesproxy.com:8443/ + my api endpoint
I just changed the host portion of all my api endpoints to: http://localhost.charlesproxy.com:8443/ and it worked.
I finished creating my social app yesterday and uploaded it to the Play Store. Using the ip address http://192.168.56.1/index.php on an emulator, it was working, but now in a real android device, it doesn't work.
How can I fix this issue ?
I even assigned my ip address but didn't work.
Help will be appreciated.
Actualy you are trying to access to your local server from a remote device, so this is normal! you have to put your web services in an online server (PUBLIC IP) ... The application keep working for you because you already have WAMP server runing localy, if you turn down your server it won't work anymore .. The android device doesn't have access to your WAMP, unlike the emulator!
Note: If you put your WAMP online, you can manage to run your android application, but this is not a good solution because you need something available 7/7 & 24/24 ( a web server ), you can host your scripts on a shared hosting server for a cheap price ..
I'm developing an android app with Google app engine endpoint using Android Studio.
Is it possible to make the local app engine server open the port it is running on? I'm trying to debug an android application with a phone that is in the same LAN as my app engine server but I can't do that because the ports doesn't open.
Meaning, while I'm able to reach the server program at localhost:8080 from the server computer, I'm not able to reach it from my phone at {server_ip}:8080.
Now I'm sure I am not having problems with port-forwarding in my router, since
when I take the generated war-file and deploy it to a tomcat server, I'm able to reach the server from my phone. But then I will not be able to do a step-by-step debugging in Android Studio.
Thanks NNJ,
After reading that post (https://stackoverflow.com/a/21776775), I understood that I should include httpAddress = '0.0.0.0' in my build.gradle for the server module and now I'm able to reach the endpoints from outside the server.
I have installed the latest version of the WSO2 EMM v1.1.0. Followed all of the Installing, Deployment, and Running documentation.
The server is up and running, I added my Gmail info into the setting in the EMM console so I can send out invites. I added a user and sent an invite. It is received by the client phone (connected on the same LAN as the server). The app can be downloaded. I put in the server IP address, the users email and the password given in the email.
When I hit the 'Register' button I get this prompt, "'Connection Failed' Server is unavailable. Please contact administrator."
I have done two clean installs of the WSO2 EMM software, re-imputed the IP address in the Android client app, and have actually tried both "HTTP ; 9763" and "HTTPS ; 9443" within the CommonUtilities class.
I am at a loss as what to try next, any help would be much appreciated thank you.
Is your android phone and your server connected to the same network connection? If so, can you connect your android phone to your PC which has eclipse (with android sdk configured) and let me know what is displayed in the logcat when you hit the 'Register' button.
You have to login to EMM app atleast once before doing a device enrollment. This could be due to APIs being not published to the API store we have embedded in the EMM server. Check on the following path https://{server_domain}:9443/productapistore. Check whether there exist any published APIs. Also check your connection. Check whether you can access the EMM app through your mobile browser.