如何在Android Studio上连接数据库/ php文件。 cmricths是laravel文件夹。
这是Android Studio的代码。 Constants.class
public class Constants {
// private static final String ROOT_URL = "http://192.168.1.144/api/";
// private static final String ROOT_URL = "http://cmricths.spcf-partners.com/androidtest/";
private static final String ROOT_URL = "http://cmricths.spcf-partners.com/api/";
public static final String USER_LOGIN = ROOT_URL+"function/userLogin.php";
//News Feed
public static final String NEWS_FEED = ROOT_URL+"function/newsFeed.php?username=";
public static final String NEWS_FEED_DATA = ROOT_URL+"function/newsFeedData.php?username=";
//Section & Grade
public static final String USER_SECTION = ROOT_URL+"function/userSection.php?username=";
public static final String USER_GRADE = ROOT_URL+"function/userGrade.php?username=";
//Profile
public static final String USER_PROFILE = ROOT_URL+"function/userProfile.php?username=";
}
错误是它无法连接到数据库/ php文件。 当我在手机上运行时,它总是“无连接”。
我正在使用网址。
private static final String ROOT_URL = "http://cmricths.spcf-partners.com/api/";