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 camera2 api MediaRecorder stop() error
Return a value stored in Firebase Android
Navigate to main fragment from viewpager
Google Play Service out of date error
Display video stored in SD card in a GridView
Android Studio - Is it mandatory to convert existing project layouts to constraint layout?
Reliable way to prompt mobile user for image gallery apps from web page
How to show OFF state of switch from Code
android.view.InflateException: Binary XML file : Error inflating class fragment
Robot Framework: Invalid argument specification: Only last argument can be kwargs
Tabhost content not showing when i upgrade android.support.v4
Offline G-Voice Recognition of Certain Words
Volley & AsyncTask : Response orrder
Android SQLite: Replace old database with a new one or use migration scripts
React-Native + Android, only build for armeabi architecture
ListView tools:listitem not working in android studio 2.2 stable channel

Categories

HOME
windows
grok
developer-tools
polymer
components
mstest
composite-primary-key
socket.io
spring-data-mongodb
cq5
limit
modal-dialog
computer-science
jquery-ui-sortable
android-securityexception
ycsb
scrolltop
android-intent
parameter-passing
scsi
standards
nodemcu
sar
jquery-ias
strongname
expressionengine3
xcode-ui-testing
delimiter
nstimer
gitlab-api
livelink
simplecv
papaparse
magento-1.9.3
xv6
angular-http
vaadin-charts
snapchat
proget
netbeans6.8
tf
google-cse
pair-programming
template-toolkit
universal-analytics
mathcad
vibrate
swingworker
pocketsphinx-android
rmongo
stax
avspeechsynthesizer
pushbots
np-spring
character-replacement
gocql
vacuum
rdflib
graphics2d
dnssec
nsurlsessiondatatask
umlgraph
broadband
gamekit
jbake
ghcjs
sip-server
crowd
sql-scripts
webfinger
strawberry-perl
with-statement
build-script
functional-java
dct
gae-quotas
qscrollarea
conditionaltagsupport
mt4j
light
script#
asdf
dolby-audio-api
alice
preload
web-notifications
qtconcurrent
window-decoration
infobright
u2netdk
rmdir
cgbitmapcontextcreate
django-paypal
nhprof
folding
lobo-cobra
change-management
netbeans6.1

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