The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hi everyone,

I am  developing mobile configuration (Android) and I want to check internet connection. Is that possible? If that's possible how can I do that? Can you help me please?

 
#2
People who like this: 0 Yes / 0 No
Active user
Rating: 2
Joined: Aug 28, 2015
Company:

Hello Mehmet Tuğrul SARIÇİÇEK. You can use:

Code
Try 
//Here you can connect to some WS-reference or anything you wish
InternetConnectionAvailable = true;
Except
InternetConnectionAvailable = false;  
EndTry;

Edited: Samir Muqimov - Aug 31, 2015 05:04 AM
 
#3
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Thank you so much but I don't understand I mean, I want to check wifi connection or mobile internet connection. Is that possible as you said ?

Edited: Mehmet Tuğrul SARIÇİÇEK - Aug 31, 2015 06:54 AM
 
#4
People who like this: 0 Yes / 0 No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

Hi Mehmet. The solution provided by Samir is that you have to call an web service to check the internet connection. If the application do not connect to the web service reference Samir want to say you don`t have internet connection. In some cases this method will work, but not always, because the web service can give you an error even if you have internet connection.
Unfortunately i don`t know any valid method to check in your mobile application you have some wireless connection or mobile data connection.

Maybe Timofey can give us a solutin to this problem.

What`s your point Timfoey?

Hope you understand what I want to say.

 
#5
People who like this: 0 Yes / 0 No
Active user
Rating: 2
Joined: Aug 28, 2015
Company:

Actually yes. If you managed to connect to any webservice then you have available internet connection otherwise you don't have access to internet.

Marius Gidu is absolutely right.There are not so many ways to check internet connection.

 
#6
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Marius Gidu,

Hi Marius, I got it what you said and I want to say same yours.

 
#7
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello,

Would you please provide more information on the task, because even if you have an Internet connection, it might not work well enough, for example.

Do you need to detect that Wi-fi (not billable) connection is available or at least any usable?

Are you trying to make push notifications?

 
#8
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Timofey Bugaevsky,

Hello Mr.Bugaevsky;

I am developing android mobile sales configuration. I want to act one process. I mean if salesman's android tablet or phone have any internet connection(3G or Wi-Fi doesn't matter) this process can work. If it doesn't have any internet connection I want to show "Please check your internet connection, this process can't work without internet".

I hope I can tell what I want.

No I didn't try sir.

İs that possible in 1C?

Edited: Mehmet Tuğrul SARIÇİÇEK - Sep 08, 2015 04:42 AM
 
#9
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Mehmet Tuğrul SARIÇİÇEK,

For your case I can suggest you the following method:

Users can see the connection status on the status bar in the top of the screen.

In case of problems with connection (it can happen even if the connection exist, but not stable) you can catch the problem as Samir Muqimov suggested and display a warning message.

Think, this is better, than hoping that if the connection is set it is 100% works fine.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)