Android Question problem connection my own host

Mehrzad238

Member
from yesterday i have problem connecting with my own host first thought maybe problem was with my SDK or JDK,updated both of them and still for somE reason I cannot connect with my own host
here is things i tried:

i tested with google.com and b4x.com it worked perfectly i know that problem its not with SDK or JDK

i used this code for testing:
B4X:
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("https://anishopmarket.ir/")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release

the error is this
B4X:
ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host "anishopmarket.ir": No address associated with hostname, Response:

can anyone help me with this?
 
Solution
Such errors are never related to the SDK version of JDK version.

The error means that the device cannot resolve the domain name to an address. Maybe the device isn't connected to the internet. Another option is that your server dns isn't configured properly.

teddybear

Well-Known Member
Licensed User
The website works. which network are you using?
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
** Activity (main) Resume **
*** Receiver (httputils2service) Receive (first time) ***
(Http client initialized with accept all option.)
<!doctype html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>آنی شاپ - فروشگاهی برای همه</title>
    <link rel="shortcut icon" type="image/x-icon" href="images/hnet.com-image.ico">
    <!-- Required meta tags -->
    
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="keywords" content="HTML5, bootstrap, mobile, app, landing, ios, android, responsive">
    <meta name="enamad" content="172206" />
    
    <!-- Font -->
    <link rel="dns-prefetch" href="//fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css?family=Rubik:300,400,500" rel="stylesheet">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Themify Icons -->
    <link rel="stylesheet" href="css/themify-icons.css">
    <!-- Owl carousel -->
    <link rel="stylesheet" href="css/owl.carousel.min.css">
    <!-- Main css -->
    <link href="css/style.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.rtlcss.com/bootstrap/v4.2.1/css/bootstrap.min.css" integrity="sha384-vus3nQHTD+5mpDiZ4rkEPlnkcyTP+49BhJ4wJeJunw06ZAp+wzzeBPUXr42fi8If" crossorigin="anonymous">
</head>
<body data-spy="scroll" data-target="#navbar" data-offset="30">
    <!-- Nav Menu -->
    <div class="nav-menu fixed-top">
        <div class="container">
            <div class="row" dir="rtl">
                <div class="col-md-12">
                    <nav class="navbar navbar-dark navbar-expand-lg">
                        <a class="navbar-brand" href="index.html"><img src="images/logo.png" class="img-fluid" alt="logo"></a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
                        <div class="collapse navbar-collapse" id="navbar">
                            <ul class="navbar-nav ml-auto">
                                <li class="nav-item"> <a class="nav-link active" href="#home">خانه <span class="sr-only">(current)</span></a> </li>
                                <li class="nav-item"> <a class="nav-link" href="#usage">استفاده از برنامه</a> </li>
                                <li class="nav-item"> <a class="nav-link" href="#gallery">اسکرین شات ها</a> </li>
                                <li class="nav-item"> <a class="nav-link" href="#about us">درباره ما</a> </li>
                                <li class="nav-item"> <a class="nav-link" href="#contact">تماس با ما</a> </li>
                              
                            </ul>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </div>
    <header class="bg-gradient" id="home">
           <div class="section">
            <div class="container">
                <div class="row">
                    <div class="col-md-6">
                        <img src="images/bgmain.png" alt="dual phone" class="img-fluid">
                    </div>
                    <div class="col-md-6 d-flex align-items-center">
                        <div class="call-to-action">
                        <h2>دانلود برنامه</h2>
                        <p class="tagline">برنامه رو برنامه رو میتوانید از لینک زیر دانلود کنید</p>
                        <div class="my-4">
                        <!--    <a href="#" class="btn btn-light"><img src="images/bazar.png" alt="icon">دانلود از بازار</a>-->
                            <a href="https://anishopmarket.ir/Anishop/App/Anishop.apk" class="btn btn-light"><img src="images/down-arrow.png" alt="icon"> دانلود با لینک مستقیم</a>
                        </div>
                        <p style="color: #FFFF00"><small><i>اندروید 5 به بالا</i></small></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>
  
    <!-- // end .section -->
    <div class="section light-bg" id="usage" dir="rtl">
         <div class="section-title">
                <small>استفاده از برن�
Message longer than Log limit (4000). Message was truncated.
 
Upvote 0

Mehrzad238

Member
the problem was with my Android simulator, after downloading the last version of BlueStacks the problem was solved.
for some reason the other Android simulators couldn`t
 
Upvote 0

Mehrzad238

Member
thanks for trying it was helpful.
with the help of @Erel, managed to figure out what was the problem
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…