I am trying to write android app which sends photos to FTP server. I use Appache-commons-net library to do so. When device uses Wi-Fi everything is fine, photos are uploaded to FTP server. But my customer wants this app to be able to do the same when Wi-Fi in app is turned off and device gets net from personal computer(Windows) connected to the device via USB cable. I was able to connect device using "gnirehtet":
https://medium.com/genymobile/gnirehtet-reverse-tethering-android-2afacdbdaec7
When I use gnirehtet my app uploads only firsth photo to FTP server and hangs on getting reply code at the end of "_storeFile" function in FTPClient class of AppacheCommonsNet. When I use WiFi everything is ok, the problem is only when I use reverse tethering. I checked other reverse thetering solutions and I met the same problem.
Does anybody knows why it happens? Or what I have to do to make it work?
I have contacted with gnirehtet library author, he made a fix yesterday. Everything now workas as should, all files are copied via USB connection using ApacheCommonsNet library.
Fix is aviable on dev branch:
https://github.com/Genymobile/gnirehtet/tree/dev
Related
I am working on a Viro Media project with three other people. Two of us have Android, and two of us have iPhones. When one of the iPhone people ran the testbed server with an ngrok link, it seems that both of the iPhone users were able to connect to the testbed. However, when I (android user) and the other android user try connecting to the same link, we get "Error connecting to package server" and "Could not connect to development server" after reloading it. The two of us (android users) decided to run it locally on our own machines to test it while both our server and our phone is connected to the same wifi, and we are both still receiving this error. I can confirm that we all have ViroReact 2.17.0. Is there some extra setup necessary in Android to get this working? Thanks.
After hours of troubleshooting, we figured out the problem. For anyone in the future running into this error, when you put the ngrok link into the app, you must delete out http:// out of the link for it to work.
I have a multi-tenant web app like
http://xxxxx.constant-domain.com:8080/
in my host file
127.0.0.1 xxxxx.constant-domain.com
The device that has the android app running is connected via ADB which calls my webapp's Rest Apis to get and send data and
It runs fine on dev and prod environments like
http://xxxxx.dev.constant-domain.com/get-data
but the problem is I want to debug it on my local server. I tried adding the given domain as base url but it doesn't work.
I tried adding http://localhost:8080/ as well but it doesn't work.
I tried looking for questions here but didn't find anything that would help.
I'm using retrofit for Api calls.
Any help would be appreciated.
First of all, make sure that your local server and your device are using a same wifi. And then find out the option to put your local server online. There is an option in Wamp Server to put it online. I don't know which software you are using to setup apache or any kind of server on your computer.
And then you will be able to access your local server by ip address. Also there is an option to edit virtual hosts of your server to allocate a specific port that the app can connect.
It doesn't matter whether you use Retrofit or Volley or Okhttp or any other things. You need to setup your local server to be online within your local network.
I figured it out. All I needed to do was to set my private Ip as
http://192.168.8.400:8080/get-data
Hope this helps anyone who is in this situation.
I have a Xamarin Solution with an Android, iOS, and Windows mobile solution. I also have a Web Server that sits on localhost:XXXX.
I need to be able to access the URI endpoints on my local, while debugging on Mobile.
While the Web Server is running I go to fiddler, and compose http://localhost:XXXX/api/Locationsand everything is correct, I get the JSON data and life is good.
However when debugging the App on any phone, I suspect the endpoint on the phone is trying to access it's own "localhost". Is there a hosts file that I can edit on the emulators? or another solution?
If you have WiFi, change localhost to your local IP address and connect phone to that WiFi
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 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,