Bukan Materi Pelajaran yang Sulit, tapi Memulai Untuk Belajar itu yang Sulit.

Get Value String URL From Other Public Class - Java Android

2:02 PM Posted by Unknown No comments
بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم

If you have many value String type URL for publishing to other class, you can use the script like this:

package com.rki.yourwebsite.url;

import android.app.Application;

/**
 * Created by User on 18/09/2015.
 */
public class URLS extends Application{
    private static URLS data;

    public static String url_login_users = "http://yourwebsite.com/api/user_login.php";
    public static String url_valid_email = "http://yourwebsite.com/api/user_valid_email.php";
    public static String url_reg_user = "http://yourwebsite.com/api/user_reg.php?a=";
    public static String url_reg_user_G = "http://yourwebsite.com/api/user_reg_google.php?i=";
    public static String url_view_user = "http://yourwebsite.com/api/user_view.php?id=";
    public static String url_view_profile = "http://yourwebsite.com/api/profile_view.php?id=";

    public static String url_feed_educate = "http://yourwebsite.com/api/feeds.php";
    public static String url_feed_evaluate = "http://yourwebsite.com/api/feeds_evaluate.php?user_id";
    public static String url_feed_evaluate_detail = "http://yourwebsite.com/api/feeds_evaluate.php?id=";
    public static String url_feed_evaluate_vote = "http://yourwebsite.com/api/feeds_evaluate_vote.php?feed_id=";
    public static String url_feed_evaluate_vote_status = "http://yourwebsite.com/api/feeds_evaluate_vote_status.php?feed_id=";
    public static String url_feed_evaluate_comment = "http://yourwebsite.com/api/comment_evaluate.php?feed_id=";
    public static String url_feed_evaluate_comment_view = "http://yourwebsite.com/api/comment_evaluate_view.php?feed_id=";

    public static URLS getInstance() {
        return data;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        data = this;
    }
}

 and you can call the value string type like this
String api_login = URLS.url_login_users;
 

0 komentar:

Post a Comment