Фриланс

Фриланс


<?xml version="1.0" encoding="utf-8"?> 

<android.support.constraint.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" 

tools:context="ru.ddfgnteva.MainActivity"> 


<LinearLayout 

android:layout_width="match_parent" 

android:layout_height="match_parent" 

android:orientation="vertical"> 


<WebView 

android:id="@+id/WebView" 

android:layout_width="match_parent" 

android:layout_height="match_parent" /> 

</LinearLayout> 


</android.support.constraint.ConstraintLayout>


----------------------------------------------------------------------------------------------------

Манифест

----------------------------------------------------------------------------------------------------


<?xml version="1.0" encoding="utf-8"?> 

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 

package="ru.wertrgteva"> 

<uses-permission android:name="android.permission.INTERNET" /> 

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 

<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> 

<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 

<uses-permission android:name="android.permission.WRITE_SETTINGS" /> 

<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 




<application 

android:allowBackup="true" 

android:icon="@mipmap/ic_launcher" 

android:label="@string/app_name" 

android:roundIcon="@mipmap/ic_launcher_round" 

android:supportsRtl="true" 

android:theme="@style/AppTheme"> 

<activity android:name=".MainActivity"> 

<intent-filter> 

<action android:name="android.intent.action.MAIN" /> 


<category android:name="android.intent.category.LAUNCHER" /> 

</intent-filter> 

</activity> 

</application> 


</manifest>




----------------------------------------------------------------------------------------------

Основной файл

-------------------------------------------------------------------------------------------------

package ru.fhjhjkfghjva;

import android.annotation.SuppressLint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {
   private WebView web;

    @SuppressLint("SetJavaScriptEnabled")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        web = findViewById(R.id.WebView);
        WebSettings ws = web.getSettings();
        ws.setJavaScriptEnabled(true);
        web.loadUrl("https://fghjfghjva.ru");
        web.setWebViewClient(new WebViewClient());
        web.setWebChromeClient(new WebChromeClient());
    }

    @Override
    public void onBackPressed() {
        if (web.canGoBack())
            web.goBack();
        else
            super.onBackPressed();
    }
}

-----------------------------------------------------

navigator.geolocation.getCurrentPosition(function(position) {

  var lat = position.coords.latitude;

  var lng = position.coords.longitude;


});