К примеру чтобы по запросу по 80 порту к git.myhost.ru запрос шел на 192.168.0.1:3000 а запрос mart.myhost.ru шел на 192.168.0.1:3001
route add webservices.example.com mask 255.255.255.255 192.168.1.0
отправить POST запрос на Android
private void getFirebaseToken() {
FirebaseMessaging.getInstance().getToken()
.addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
if (task.isSuccessful()) {
// Get new FCM registration token
// Log and toast
fbtoken = task.getResult();
handleFirebaseResult();
//Log.d("Firebase id", fbid);
//Log.d("Firebase token", fbtoken);
}
}
private void sendRegistrationToServer() {
// TODO: Implement this method to send token to your app server.
}
});
}
boolean connected = false;
ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if(connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED ||
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED) {
//we are connected to a network
connected = true;
}
else
connected = false;
RecyclerView historyRecyclerView = binding.adrecyclerView;
historyRecyclerView = historyRecyclerView.findViewById(R.id.adrecycler_view);
HistoryViewRecycler historyView = new HistoryViewRecycler();
historyView.initRecycler(historyRecyclerView);
swipeRefreshLayout = binding.swipeRefreshLayout.findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//make new recycle view on swipe refresh
RecyclerView newhistoryRecyclerView = binding.adrecyclerView;
HistoryViewRecycler newhistoryView = new HistoryViewRecycler();
JSONArray newhistory = new HistoryViewRecycler().updateHistory(getContext());
if (newhistory == null) {
new History().getFullHistory(getContext());
//Snackbar.make(getActivity().findViewById(android.R.id.content), R.string.auth_error, 3000).setDuration(5000).show();
}
newhistoryView.initRecycler(newhistoryRecyclerView);
swipeRefreshLayout.setRefreshing(false);
}
});
DialogInterface.OnClickListener()
В списке сохраненных страниц технологии композита непонятные страницы. Сотни страниц.
И каким образом они монетизируются?
чем плохи бесплатные сервисы VPN
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollView4"
android:layout_width="wrap_content"
android:layout_height="250dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/donotshow"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/policy_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:text="@string/policy_disclosure_ru"
android:textColor="#000000"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<CheckBox
android:id="@+id/donotshow"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Больше не показывать"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollView4"
android:layout_width="wrap_content"
android:layout_height="300dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/data_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:text="@string/data_disclosure_ru"
android:textColor="#000000"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
public void policytextshow(){
LayoutInflater li = LayoutInflater.from(this);
View promptsView = li.inflate(R.layout.policy_popup, null);
//Make AlertDialog
AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(this);
//Настраиваем .xml для нашего AlertDialog:
mDialogBuilder.setView(promptsView);
//Настраиваем отображение поля для ввода текста в открытом диалоге:
//Настраиваем сообщение в диалоговом окне:
CheckBox hidebox = (CheckBox) promptsView.findViewById(R.id.donotshow);
mDialogBuilder
.setCancelable(false)
.setIcon(R.drawable.shield1)
.setTitle("Политика информации")
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
if (hidebox.isChecked()) {
SharedPreferences.Editor editor = mSettings.edit();
editor.putString(APP_PREFERENCES_SHOWPOLICY, "1");
editor.apply();
}
dialog.cancel();
// if policy alert dialog closed - work with contacts list
contacts();
}
});
//Создаем AlertDialog:
AlertDialog alertDialog = mDialogBuilder.create();
//и отображаем его:
alertDialog.show();
LayoutInflater li1 = LayoutInflater.from(this);
View promptsView1 = li1.inflate(R.layout.data_popup, null);
//Make AlertDialog
AlertDialog.Builder mDialogBuilder1 = new AlertDialog.Builder(this);
//Настраиваем .xml для нашего AlertDialog:
mDialogBuilder1.setView(promptsView1);
//Настраиваем отображение поля для ввода текста в открытом диалоге:
//Настраиваем сообщение в диалоговом окне:
mDialogBuilder1
.setCancelable(false)
.setIcon(R.drawable.shield1)
.setTitle("Используемые данные")
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog1,int id) {
if (hidebox.isChecked()) {
SharedPreferences.Editor editor = mSettings.edit();
editor.putString(APP_PREFERENCES_SHOWPOLICY, "1");
editor.apply();
}
dialog1.cancel();
}
});
//Создаем AlertDialog:
AlertDialog alertDialog1 = mDialogBuilder1.create();
//и отображаем его:
alertDialog1.show();
}