android


Use Volley library for checking connection to web server


I have a .Net web service (asmx). In the android app when i use Wifi connection every thing goes well. But when i use the internet data of provider, i always receive disconnected in the class that want to check the connectivity (by use of HttpUrlConnection). I decided to use Volley library to check connection as below:
StringRequest postReq = new StringRequest(Request.Method.GET,
"http://94.183.160.71/sibwebservice.asmx", <- Real address
new Response.Listener<String>() {
#Override
public void onResponse(String response) {
Toast.makeText(activity.getApplicationContext(),
"Response from server",
Toast.LENGTH_LONG).show();
}
},
new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
Toast.makeText(activity.getApplicationContext(),
error.toString(),
Toast.LENGTH_LONG).show();
}
});
// Add the request to the queue
Volley.newRequestQueue(this).add(postReq);
Unfortunately, i always give Volley.TimeOut exception, but when i open url by the device browser, i can see the methods of web service (using data).
Do you any idea about successfully connecting the address? Thanks in advances.

Related Links

Android NFC Android Application Records Error
windows 7 adb driver Samsung galaxy S3
How can I make images disappear from a grid view on touch?
A different make file for each architecture - Android NDK
onListItemClick stops working after one click
non full screen activity
Referencing the Facebook SDK in my Android project
How to add Android-ViewPagerIndicator library to maven project
Where are Shared Preferences saved on Nexus S? [duplicate]
Android Spawn Enemies by time
Using CursorLoader to get contacts causes duplication
Make Datepicker look on Android 4.0 as 2.x
getting error as document is empty(size 0kb) when opening pdf file in micromax funbook
Accept a RatingBar value when the default value is selected
How to correctly sign apps in CyanogenMod?
Getting GIDs from any Android Application

Categories

HOME
assembly
oracle12c
localization
telegram
alexa-skills-kit
mysql-workbench
shiro
opendj
soa
scripting
android-json
bing-maps
32bit-64bit
java.util.logging
emoji
libc
intercom
magnetic-cards
flatpak
google-content-api
video-editing
html5-appcache
sigma.js
nodemcu
solrcloud
drive
backpack-for-laravel
question2answer
r-mice
ios10.2
flask-sqlalchemy
game-theory
dapper-extensions
intersystems-cache
iis-express
calculation
gitlab-api
mobx
cart
hibernate-search
pdw-file-browser
baidu-map
apiary.io
swagger-php
hivemq
latitude-longitude
google-earth-engine
dm-script
protein-database
branching-and-merging
movilizer
print-css
wc
fclose
twilio-click-to-call
mongotemplate
appdomain
otp
mouseleave
d3-force-directed
py2neo
rsa-archer-grc
cubism.js
builtins
reporting-services-2012
pacemaker
qtplugin
signalr.client
rspec2
cortex-m
directdraw
character-replacement
dynamics-nav-2016
xenomai
aspectj-maven-plugin
node-serialport
fail2ban
procedural-programming
cryptographichashfunction
ejb-2.x
delayed-execution
theos
administration
sql-scripts
easyrtc
punycode
rickshaw
formview
rcaller
grails-domain-class
radiant
vsx
amslidemenu
bin
model-driven-development
windows-98
qtconcurrent
uimanageddocument
failing-tests
infobright
entity-attribute-value
role
photolibrary
objective-j
aspmenu
ajax-polling
interprocess
pos-for-.net
cldc
perl5.12

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App