با سلام خدمت دوستان عزیز لطفا راهنماییم کنید تو پروژه به یه مشکلی برخوردم 2-3 روزه هر چی میگردم سایتهای داخلی و خارجی رو گشتم چیزی پیدا نمیکنم
من می خوام از دیتابیس mysql داده ها رو با json پارس کنم و تو آندروید و داخل یه لیست ویو نمایش بدم اول تو یه هاست رایگان (gigfa) تست کردم برنامه کرش میشه اینم کد کرش:

$ adb shell am start -n "com.example.farshid.myconnect/com.example.farshid.myconnect.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 1823 on device emulator-5554
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/: HostConnection::get() New Host Connection established 0xb7a14f60, tid 1823
W/EGL_emulation: eglSurfaceAttrib not implemented
D/OpenGLRenderer: Enabling debug mode 0
D/dalvikvm: GC_FOR_ALLOC freed 72K, 5% free 2903K/3040K, paused 2ms, total 2ms
I/dalvikvm-heap: Grow heap (frag case) to 3.503MB for 635808-byte allocation
D/dalvikvm: GC_FOR_ALLOC freed 2K, 4% free 3522K/3664K, paused 1ms, total 2ms
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xaf849b20)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.farshid.myconnect, PID: 1823
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.farshid.myconnect/com.example.farshid.myconnect.AllProductsActivity} : java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThre ad.java:135)
at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:10 2)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.jav a:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
at android.app.ListActivity.onContentChanged(ListActi vity.java:243)
at com.android.internal.policy.impl.PhoneWindow.setCo ntentView(PhoneWindow.java:293)
at android.app.Activity.setContentView(Activity.java: 1929)
at com.example.farshid.myconnect.AllProductsActivity. onCreate(AllProductsActivity.java:51)
at android.app.Activity.performCreate(Activity.java:5 231)
at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThre ad.java:135)
at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:10 2)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.jav a:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:595)
at dalvik.system.NativeStart.main(Native Method)
Application terminated.


و فایل php و فایل جاوای AllProductsActivityو MainActivity رو هم ضمیمه کردم
لطفا راهنمایم کنید
<?php

$host= "sbt-upvc.ir/myphp";
$dbname="sbtupvci_myShop";
$user = "sbtupvci_shop";
$pass = "farshid";

$response = array();

$con = mysqli_connect($host,$user,$pass,$dbname);
// get all products from products table
$sql = "select * from tblshop ";
$result = mysqli_query($con,$sql);
//$result = mysqli_query($con,"SELECT *FROM tblshop");

// check for empty result
if ($result->num_rows > 0) {
// looping through all results
// products node
$response["tblshop"] = array();

while ($row = mysqli_fetch_array($result)) {
// temp user array
$product = array();
$product["idImage"] = $row["idImage"];
$product["nameKala"] = $row["nameKala"];
$product["fiPrice"] = $row["fiPrice"];
$product["description"] = $row["description"];
//$product["updated_at"] = $row["updated_at"];



// push single product into final response array
array_push($response["tblshop"], $product);
}
// success
$response["success"] = 1;

// echoing JSON response
echo json_encode($response);
} else {
// no products found
$response["success"] = 0;
$response["message"] = "No products found";

// echo no users JSON
echo json_encode($response);
}
?>

package com.example.farshid.myconnect;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class AllProductsActivity extends ListActivity {
// Progress Dialog
private ProgressDialog pDialog;

// Creating JSON Parser object
JSONParser jParser = new JSONParser();

ArrayList<HashMap<String, String>> productsList;
// url to get all products list
private static String url_all_products = "http://sbt-upvc.ir/myphp/get_all_products.php";

// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_PRODUCTS = "tblshop";
private static final String TAG_nameKala= "nameKala";
private static final String TAG_fiPrice = "fiPrice";

// products JSONArray
JSONArray tblshop = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.all_products);

// Hashmap for ListView
productsList = new ArrayList<HashMap<String, String>>();

// Loading products in Background Thread
new LoadAllProducts().execute();

// Get listview
ListView lv = getListView();

// on seleting single product
// launching Edit Product Screen
lv.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
String nameKala = ((TextView) view.findViewById(R.id.pid)).getText()
.toString();

// Starting new intent
Intent in = new Intent(getApplicationContext(),
EditProductActivity.class);
// sending pid to next activity
in.putExtra(TAG_fiPrice, nameKala);

// starting new activity and expecting some response back
startActivityForResult(in, 100);
}
});

}
// Response from Edit Product Activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// if result code 100
if (resultCode == 100) {
// if result code 100 is received
// means user edited/deleted product
// reload this screen again
Intent intent = getIntent();
finish();
startActivity(intent);
}

}
/**
* Background Async Task to Load all product by making HTTP Request
* */
class LoadAllProducts extends AsyncTask<String, String, String> {

/**
* Before starting background thread Show Progress Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(AllProductsActivity.this);
pDialog.setMessage("Loading products. Please wait...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}

/**
* getting All products from url
* */
protected String doInBackground(String... args) {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
// getting JSON string from URL
JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);

// Check your log cat for JSON reponse
Log.d("All Products: ", json.toString());

try {
// Checking for SUCCESS TAG
int success = json.getInt(TAG_SUCCESS);

if (success == 1) {
// products found
// Getting Array of Products
tblshop = json.getJSONArray(TAG_PRODUCTS);

// looping through All Products
for (int i = 0; i < tblshop.length(); i++) {
JSONObject c = tblshop.getJSONObject(i);

// Storing each json item in variable
String nameKala = c.getString(TAG_nameKala);
String fiPrice = c.getString(TAG_fiPrice);

// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();

// adding each child node to HashMap key => value
map.put(TAG_nameKala, nameKala);
map.put(TAG_fiPrice, fiPrice);

// adding HashList to ArrayList
productsList.add(map);
}
} else {
// no products found
// Launch Add New product Activity
Intent i = new Intent(getApplicationContext(),
NewProductActivity.class);
// Closing all previous activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
} catch (JSONException e) {
e.printStackTrace();
}

return null;
}

/**
* After completing background task Dismiss the progress dialog
* **/
protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed JSON data into ListView
* */
ListAdapter adapter = new SimpleAdapter(
AllProductsActivity.this, productsList,
R.layout.list_item, new String[] { TAG_nameKala,
TAG_fiPrice},
new int[] { R.id.pid, R.id.name });
// updating listview
setListAdapter(adapter);
}
});

}
}
}






package com.example.farshid.myconnect;
import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;

public class MainActivity extends Activity {
Button btnViewProducts;
Button btnNewProduct;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Buttons
btnViewProducts = (Button) findViewById(R.id.btnViewProducts);
btnNewProduct = (Button) findViewById(R.id.btnCreateProduct);

// view products click event
btnViewProducts.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
// Launching All products Activity
Intent i = new Intent(getApplicationContext(), AllProductsActivity.class);
startActivity(i);

}
});

// view products click event
btnNewProduct.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
// Launching create new product activity
Intent i = new Intent(getApplicationContext(), NewProductActivity.class);
startActivity(i);

}
});
}
}

الانم که هاست غیررایگان خریداری کردم php این خطاهارو میده

[12-May-2018 07:01:57 UTC] PHP Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/sbtupvci/public_html/myphp/get_all_products.php on line 10
[12-May-2018 07:01:57 UTC] PHP Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/sbtupvci/public_html/myphp/get_all_products.php on line 10
[12-May-2018 07:01:57 UTC] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/sbtupvci/public_html/myphp/get_all_products.php on line 13

لطفا راهنمایی کنید
با تشکر