├── Android studio ├── Connectivity.java ├── AndroidManifest.xml ├── build.gradle ├── activity_1.java ├── activity_1.xml ├── activity_2.java └── activity_2.xml ├── README.md └── Esp32_from_and_to_android_studio.ino /Android studio/Connectivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flowcalibration2; 2 | 3 | import java.io.IOException; 4 | 5 | import okhttp3.OkHttpClient; 6 | import okhttp3.Request; 7 | import okhttp3.Response; 8 | 9 | public class Connectivity { 10 | public static String geturl (String url_esp32){ 11 | 12 | OkHttpClient client = new OkHttpClient(); 13 | 14 | Request request = new Request.Builder() 15 | .url(url_esp32) 16 | .build(); 17 | 18 | try { 19 | Response response = client.newCall(request).execute(); 20 | return response.body().string(); 21 | 22 | } catch (IOException error) { 23 | return error.toString(); 24 | } 25 | 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32-Android-Studio 2 | ESP32 Android Studio 3 | 4 | This project explain how to receive data from ESP32 and show the value on Android App 5 | 6 | and send data to ESP32 from Android App which we build for turning on LED or something 7 | 8 | Just for infomartion, ESP32 and ESP8266 have same principle work also programming. 9 | But, if u try to use this program and compiling to ESP8266 change library " #include wifi.h" into "#include esp8266wifi.h" 10 | 11 | i already share how to build this project on my YouTube channel. U guys can support me to subs and like the video. 12 | 13 | I separate the video into 3 part : 14 | 15 | part 1 : Send data From Web to ESP32 (https://youtu.be/8UWpnN-A0do) 16 | 17 | part 2 : Receive data on Web from ESP32 (https://youtu.be/PTqr-8-afkc) 18 | 19 | part 3 : Receive and send data ESP32 android app (https://youtu.be/xBh8qh2zZ0k) 20 | 21 | -------------------------------------------------------------------------------- /Android studio/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Android studio/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdkVersion 30 7 | buildToolsVersion "30.0.3" 8 | 9 | defaultConfig { 10 | applicationId "com.example.flowcalibration2" 11 | minSdkVersion 23 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | } 30 | 31 | dependencies { 32 | 33 | implementation 'androidx.appcompat:appcompat:1.2.0' 34 | implementation 'com.google.android.material:material:1.3.0' 35 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 36 | testImplementation 'junit:junit:4.+' 37 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 39 | implementation 'com.squareup.okhttp3:okhttp:4.9.0' 40 | } 41 | -------------------------------------------------------------------------------- /Android studio/activity_1.java: -------------------------------------------------------------------------------- 1 | // Little project from wiwidnadw 2 | // program use java language 3 | //u can reach me on https://github.com/wiwidnadw 4 | //https://www.youtube.com/channel/UClxwaaJ-or0SJtlWMi3pHpA 5 | // line : wiwidnadw 6 | //gmail : nurahmaddw@gmail.com 7 | 8 | package com.example.flowcalibration2; 9 | 10 | import android.content.Intent; 11 | import android.os.Bundle; 12 | import android.view.View; 13 | import android.widget.Button; 14 | import android.widget.EditText; 15 | 16 | import androidx.appcompat.app.AppCompatActivity; 17 | 18 | public class activity_1 extends AppCompatActivity { 19 | private EditText ip; 20 | private Button enter_ip; 21 | public static String ip_address; 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_1); 27 | 28 | ip=(EditText) findViewById(R.id.edit_ip_address); 29 | enter_ip=(Button) findViewById(R.id.button_ip); 30 | 31 | enter_ip.setOnClickListener(new View.OnClickListener() { 32 | @Override 33 | public void onClick(View v) { 34 | ip_address = ip.getText().toString(); 35 | Intent intent = new Intent(activity_1.this, activity_2.class); 36 | startActivity(intent); 37 | 38 | 39 | } 40 | 41 | }); 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Android studio/activity_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 |