OneConnect SDK is an Android library that provides easy access to OneConnect API, allowing you to retrieve server information for VPN services. You can use this library to fetch both free and premium servers for your VPN application.
Installation
To use this library, you should add jitpack repository.
Once you have fetched server information, you can parse the JSON response to obtain the server details. Here's an example of how to convert the JSON response into an ArrayList of Countries objects:
ArrayList<Countries> servers = new ArrayList<>();
try {
JSONArray jsonArray = new JSONArray(Constants.FREE_SERVERS);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject object = jsonArray.getJSONObject(i);
servers.add(new Countries(
object.getString("serverName"),
object.getString("flag_url"),
object.getString("ovpnConfiguration"),
object.getString("vpnUserName"),
object.getString("vpnPassword")
));
}
} catch (JSONException e) {
e.printStackTrace();
}
Make sure to replace Countries with the appropriate data model in your project.
Ready demo project
Here we have ready demo project , you can frog from GitHub and use
You have to Put inside SplashScreen.java Please See Screenshot
# This Project Content AdMob & Facebook Ads those developers want to Add Another Ads SDK they need to follow the Exiting Method of Ads SDK and Also Have IAP Subscription.
And Need to Put Your Google-Services.JSON file inside Project, You will get from Firebase.
Note :- Any Developer, those who want to Use or Sell for end Client
they need to make the sufficient Changes in the Original Demo Project.