├── Android_Wifi ├── .gitignore ├── .idea │ ├── gradle.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── tofaha │ │ │ └── Android_wifi │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── tofaha │ │ │ │ └── Android_wifi │ │ │ │ ├── Pref.kt │ │ │ │ ├── Util.kt │ │ │ │ ├── app │ │ │ │ ├── Constant.kt │ │ │ │ ├── MyData.kt │ │ │ │ └── TofahaApplication.kt │ │ │ │ ├── connection │ │ │ │ ├── CLoseConnection.kt │ │ │ │ ├── OpenConnection.kt │ │ │ │ └── SendMessages.kt │ │ │ │ ├── dagger │ │ │ │ ├── AppComponent.kt │ │ │ │ ├── AppModule.kt │ │ │ │ └── PreferenceModule.kt │ │ │ │ └── ui │ │ │ │ ├── AppSourceCode.kt │ │ │ │ ├── FloatingMenuFragment.kt │ │ │ │ ├── InfoActivity.kt │ │ │ │ └── main │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainView.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── code_source_white.png │ │ │ ├── ic_action_ip_logo.png │ │ │ ├── port_white.png │ │ │ ├── refresh_blue.png │ │ │ ├── send_blue.png │ │ │ └── share_white.png │ │ │ ├── drawable-mdpi │ │ │ ├── code_source_white.png │ │ │ ├── ic_action_ip_logo.png │ │ │ ├── port_white.png │ │ │ ├── refresh_blue.png │ │ │ ├── send_blue.png │ │ │ └── share_white.png │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── code_source_white.png │ │ │ ├── ic_action_ip_logo.png │ │ │ ├── port_white.png │ │ │ ├── refresh_blue.png │ │ │ ├── send_blue.png │ │ │ └── share_white.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── code_source_white.png │ │ │ ├── ic_action_ip_logo.png │ │ │ ├── port_white.png │ │ │ ├── refresh_blue.png │ │ │ ├── send_blue.png │ │ │ └── share_white.png │ │ │ ├── drawable │ │ │ ├── btn_accent_selector.xml │ │ │ ├── btn_blue_menu_button_selector.xml │ │ │ ├── btn_blue_menu_selector.xml │ │ │ ├── btn_blue_selector.xml │ │ │ ├── btn_transparent_selector.xml │ │ │ ├── esp8266.jpg │ │ │ ├── ic_filter.xml │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_app_source_code.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_main2.xml │ │ │ ├── float_menu.xml │ │ │ ├── ip_address_dialog.xml │ │ │ └── port_number_dialog.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── tofaha │ │ └── Android_wifi │ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── Arduino_ESP8266 └── Arduino_ESP8266.ino └── README.md /Android_Wifi/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Android_Wifi/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android_Wifi/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Android_Wifi/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | apply plugin: 'me.tatarka.retrolambda' 8 | apply plugin: 'com.jakewharton.hugo' 9 | 10 | 11 | android { 12 | compileSdkVersion 26 13 | defaultConfig { 14 | applicationId "com.tofaha.Android_wifi" 15 | minSdkVersion 15 16 | targetSdkVersion 26 17 | versionCode 1 18 | versionName "1.0" 19 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | } 28 | 29 | kapt { 30 | generateStubs = true 31 | } 32 | 33 | 34 | dependencies { 35 | implementation fileTree(dir: 'libs', include: ['*.jar']) 36 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 37 | implementation 'com.android.support:appcompat-v7:26.1.0' 38 | implementation 'com.android.support:cardview-v7:26.1.0' 39 | implementation 'com.android.support:design:26.1.0' 40 | implementation 'info.hoang8f:fbutton:1.0.5' 41 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 42 | testImplementation 'junit:junit:4.12' 43 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 44 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 45 | implementation 'com.jakewharton:butterknife:8.8.1' 46 | kapt 'com.jakewharton:butterknife-compiler:8.8.1' 47 | 48 | //fabulus filter 49 | implementation 'com.allattentionhere:fabulousfilter:0.0.4' 50 | 51 | // Anko 52 | implementation "org.jetbrains.anko:anko:0.10.3" 53 | 54 | // Butterknife 55 | implementation 'com.jakewharton:butterknife:8.8.1' 56 | kapt 'com.jakewharton:butterknife-compiler:8.8.1' 57 | 58 | //dagger 59 | kapt "com.google.dagger:dagger-compiler:2.9" 60 | implementation 'com.google.dagger:dagger:2.9' 61 | provided 'org.glassfish:javax.annotation:10.0-b28' 62 | } 63 | -------------------------------------------------------------------------------- /Android_Wifi/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting input build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/androidTest/java/com/tofaha/Android_wifi/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.tofaha.Android_wifi", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/Pref.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | 6 | import com.tofaha.Android_wifi.app.Constant 7 | 8 | 9 | /** 10 | * Created by ayoub on 11/23/17. 11 | */ 12 | 13 | class Pref(private val context: Context) { 14 | private val preferences: SharedPreferences 15 | 16 | var ipAddress: String? 17 | get() = this.preferences.getString(Constant.IP_ADDRESS, "non") 18 | set(ipAddress) = this.preferences.edit().putString(Constant.IP_ADDRESS, ipAddress).apply() 19 | 20 | var portNumber: Int 21 | get() = this.preferences.getInt(Constant.PORT_NUMBER, 0) 22 | set(portNumber) = this.preferences.edit().putInt(Constant.PORT_NUMBER, portNumber).apply() 23 | 24 | init { 25 | this.preferences = context.getSharedPreferences(context.packageName, 0) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/Util.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi 2 | 3 | /** 4 | * Created by ayoub on 11/23/17. 5 | */ 6 | 7 | object Util { 8 | private val ip4Regex = "^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$" 9 | 10 | fun isValidIp(ip: String): Boolean { 11 | return ip.matches(ip4Regex.toRegex()) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/app/Constant.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.app 2 | 3 | /** 4 | * Created by ayoub on 11/23/17. 5 | */ 6 | 7 | interface Constant { 8 | companion object { 9 | 10 | val IP_ADDRESS = "ip_address" 11 | val PORT_NUMBER = "port_number" 12 | val REPO_LINK = "https://github.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi" 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/app/MyData.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.app 2 | 3 | import com.tofaha.Android_wifi.ui.main.MainActivity 4 | import java.net.Socket 5 | 6 | /** 7 | * Created by ayoub on 11/26/17. 8 | */ 9 | 10 | object MyData { 11 | lateinit var socket: Socket 12 | lateinit var mainActivity : MainActivity 13 | var THREAD_RUNNING = false 14 | } 15 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/app/TofahaApplication.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.app 2 | 3 | import android.app.Application 4 | import com.tofaha.Android_wifi.dagger.AppComponent 5 | import com.tofaha.Android_wifi.dagger.AppModule 6 | import com.tofaha.Android_wifi.dagger.DaggerAppComponent 7 | 8 | /** 9 | * Created by ayoub on 11/23/17. 10 | */ 11 | class TofahaApplication : Application() { 12 | 13 | private var appComponent: AppComponent? = null 14 | 15 | override fun onCreate() { 16 | super.onCreate() 17 | appComponent = initDagger(this) 18 | } 19 | 20 | protected fun initDagger(application: TofahaApplication): AppComponent { 21 | return DaggerAppComponent.builder().appModule(AppModule(application)).build() 22 | } 23 | 24 | fun getAppComponent(): AppComponent? { 25 | return this.appComponent 26 | } 27 | } -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/connection/CLoseConnection.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.connection 2 | 3 | import android.os.AsyncTask 4 | import com.tofaha.Android_wifi.app.MyData 5 | import java.io.IOException 6 | 7 | /** 8 | * Created by ayoub on 11/26/17. 9 | */ 10 | 11 | class CLoseConnection : AsyncTask(){ 12 | 13 | override fun doInBackground(vararg params: Void?): Void? { 14 | try { 15 | 16 | MyData.socket?.close() 17 | System.out.println("connection closed") 18 | 19 | }catch (e: IOException) { 20 | e.printStackTrace() 21 | } 22 | 23 | return null 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/connection/OpenConnection.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.connection 2 | 3 | import android.os.AsyncTask 4 | 5 | import com.tofaha.Android_wifi.app.MyData 6 | 7 | import java.io.IOException 8 | import java.net.Socket 9 | 10 | /** 11 | * Created by ayoub on 11/26/17. 12 | */ 13 | 14 | class OpenConnection(private val ipAddress: String, private val portNumber: Int) : AsyncTask() { 15 | 16 | 17 | override fun doInBackground(vararg voids: Void): Void? { 18 | try { 19 | MyData.socket = Socket(ipAddress, portNumber) 20 | System.out.println("connection opened") 21 | 22 | if (MyData.THREAD_RUNNING == false){ 23 | MyData.mainActivity.receiveMessage() 24 | } 25 | 26 | } catch (e: IOException) { 27 | e.printStackTrace() 28 | } 29 | 30 | return null 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/connection/SendMessages.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.connection 2 | 3 | import android.os.AsyncTask 4 | 5 | import com.tofaha.Android_wifi.app.MyData 6 | 7 | import java.io.BufferedWriter 8 | import java.io.IOException 9 | import java.io.OutputStreamWriter 10 | import java.io.PrintWriter 11 | import java.net.Socket 12 | 13 | /** 14 | * Created by ayoub on 11/26/17. 15 | */ 16 | 17 | class SendMessages(msg: String) : AsyncTask() { 18 | 19 | internal var msg = "" 20 | 21 | init { 22 | this.msg = msg 23 | } 24 | 25 | override fun doInBackground(vararg voids: Void): Void? { 26 | try { 27 | 28 | val out = PrintWriter(BufferedWriter(OutputStreamWriter(MyData.socket 29 | .getOutputStream())), true) 30 | 31 | out.println(msg) 32 | println("message send") 33 | 34 | } catch (e: IOException) { 35 | e.printStackTrace() 36 | } 37 | 38 | return null 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/dagger/AppComponent.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.dagger 2 | 3 | import com.tofaha.Android_wifi.ui.FloatingMenuFragment 4 | import com.tofaha.Android_wifi.ui.InfoActivity 5 | import com.tofaha.Android_wifi.ui.main.MainActivity 6 | 7 | import javax.inject.Singleton 8 | 9 | import dagger.Component 10 | 11 | @Singleton 12 | @Component(modules = arrayOf(AppModule::class , PreferenceModule :: class)) 13 | interface AppComponent { 14 | 15 | fun inject(infoActivity: InfoActivity) 16 | fun inject(mainActivity: MainActivity) 17 | fun inject(target: FloatingMenuFragment) 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/dagger/AppModule.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.dagger 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | 6 | import javax.inject.Singleton 7 | 8 | import dagger.Module 9 | import dagger.Provides 10 | 11 | @Module 12 | class AppModule(private val application: Application) { 13 | 14 | @Singleton 15 | @Provides 16 | fun provideContext(): Context { 17 | return this.application 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/dagger/PreferenceModule.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.dagger 2 | 3 | import android.content.Context 4 | import com.tofaha.Android_wifi.Pref 5 | import dagger.Module 6 | import dagger.Provides 7 | import javax.inject.Singleton 8 | 9 | /** 10 | * Created by ayoub on 11/23/17. 11 | */ 12 | @Module 13 | class PreferenceModule { 14 | 15 | @Singleton 16 | @Provides 17 | internal fun providePref(context: Context): Pref { 18 | return Pref(context) 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/ui/AppSourceCode.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.ui 2 | 3 | import android.graphics.drawable.ColorDrawable 4 | import android.os.Build 5 | import android.support.annotation.RequiresApi 6 | import android.support.v7.app.AppCompatActivity 7 | import android.os.Bundle 8 | 9 | import com.tofaha.Android_wifi.R 10 | import kotlinx.android.synthetic.main.activity_app_source_code.* 11 | import android.content.Intent 12 | import android.net.Uri 13 | import com.tofaha.Android_wifi.app.Constant 14 | 15 | 16 | class AppSourceCode : AppCompatActivity() { 17 | 18 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | setContentView(R.layout.activity_app_source_code) 22 | 23 | window.statusBarColor = resources.getColor(R.color.blue_menu_button) 24 | supportActionBar!!.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.blue_menu_button))) 25 | 26 | my_repo_link.setOnClickListener({ 27 | val browser = Intent(Intent.ACTION_VIEW, Uri.parse(Constant.REPO_LINK)) 28 | startActivity(browser) 29 | }) 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/ui/FloatingMenuFragment.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.ui 2 | 3 | import android.app.AlertDialog 4 | import android.app.Dialog 5 | import android.content.Intent 6 | import android.view.View 7 | import android.widget.TextView 8 | import android.widget.Toast 9 | 10 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment 11 | import com.tofaha.Android_wifi.Pref 12 | import com.tofaha.Android_wifi.R 13 | import com.tofaha.Android_wifi.app.TofahaApplication 14 | 15 | import javax.inject.Inject 16 | 17 | import butterknife.BindView 18 | import butterknife.ButterKnife 19 | import butterknife.OnClick 20 | import com.tofaha.Android_wifi.Util 21 | import kotlinx.android.synthetic.main.ip_address_dialog.view.* 22 | import kotlinx.android.synthetic.main.port_number_dialog.view.* 23 | 24 | /** 25 | * Created by ayoub on 11/24/17. 26 | */ 27 | 28 | class FloatingMenuFragment : AAH_FabulousFragment() { 29 | 30 | @BindView(R.id.content_menu) 31 | lateinit var contentMenu: View 32 | 33 | @BindView(R.id.close_menu) 34 | lateinit var closeMenu: View 35 | 36 | @BindView(R.id.menu_ip_address_text) 37 | lateinit var ipAddress: TextView 38 | 39 | @BindView(R.id.menu_port_number_text) 40 | lateinit var portNumber: TextView 41 | 42 | @Inject 43 | lateinit var pref: Pref 44 | 45 | override fun setupDialog(dialog: Dialog, style: Int) { 46 | val myView = View.inflate(context, R.layout.float_menu, null) 47 | (activity.application as TofahaApplication).getAppComponent()!!.inject(this) 48 | ButterKnife.bind(this, myView) 49 | 50 | updateInfo() 51 | 52 | setAnimationDuration(400) //optional; default 500ms 53 | setPeekHeight(400) // optional; default 400dp 54 | //setCallbacks((Callbacks) getActivity()); //optional; to get back result 55 | //setAnimationListener((AnimationListener) getActivity()); //optional; to get animation callbacks 56 | setViewgroupStatic(closeMenu) // optional; layout to stick at bottom on slide 57 | //setViewPager(vp_types); //optional; if you use viewpager that has scrollview 58 | setViewMain(contentMenu) //necessary; main bottomsheet view 59 | setMainContentView(myView) // necessary; call at end before super 60 | super.setupDialog(dialog, style) //call super at last 61 | } 62 | 63 | @OnClick(R.id.close_menu) 64 | fun close() { 65 | closeFilter(this) 66 | } 67 | 68 | @OnClick(R.id.menu_ip_address) 69 | fun ipAddress() { 70 | showIpDialog() 71 | } 72 | 73 | @OnClick(R.id.menu_port_number) 74 | fun portNumber() { 75 | showPortDialog() 76 | } 77 | 78 | @OnClick(R.id.menu_share) 79 | fun shareApp() { 80 | val sharingIntent = Intent(Intent.ACTION_SEND) 81 | sharingIntent.type = "text/plain" 82 | sharingIntent.putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=com.tofaha.Android_wifi") 83 | startActivity(Intent.createChooser(sharingIntent, "Share with")) 84 | } 85 | 86 | @OnClick(R.id.menu_code_source) 87 | fun appCodeSource() { 88 | startActivity(Intent(context , AppSourceCode::class.java)) 89 | } 90 | 91 | private fun showIpDialog() { 92 | val alertDialog = AlertDialog.Builder(context).create() 93 | val myView = layoutInflater.inflate(R.layout.ip_address_dialog, null) 94 | alertDialog.setView(myView) 95 | myView.ip_dialog.hint = pref.ipAddress 96 | myView.ip_dialog_change.setOnClickListener({ 97 | if (Util.isValidIp(myView.ip_dialog.text.toString())){ 98 | pref.ipAddress = myView.ip_dialog.text.toString() 99 | alertDialog.dismiss() 100 | updateInfo() 101 | }else 102 | Toast.makeText(context , "Enter Valid IP" , Toast.LENGTH_SHORT).show() 103 | }) 104 | myView.ip_dialog_cancel.setOnClickListener({ 105 | alertDialog.dismiss() 106 | }) 107 | alertDialog.show() 108 | } 109 | 110 | 111 | private fun showPortDialog() { 112 | val alertDialog = AlertDialog.Builder(context).create() 113 | val myView = layoutInflater.inflate(R.layout.port_number_dialog, null) 114 | alertDialog.setView(myView) 115 | myView.port_dialog.hint = pref.portNumber.toString() 116 | myView.port_dialog_change.setOnClickListener({ 117 | if (!myView.port_dialog.text.toString().equals("")){ 118 | pref.portNumber = Integer.parseInt(myView.port_dialog.text.toString()) 119 | alertDialog.dismiss() 120 | updateInfo() 121 | }else { 122 | Toast.makeText(context , "Enter port number" , Toast.LENGTH_SHORT).show() 123 | } 124 | }) 125 | myView.port_dialog_cancel.setOnClickListener({ 126 | alertDialog.dismiss() 127 | }) 128 | alertDialog.show() 129 | } 130 | 131 | private fun updateInfo(){ 132 | ipAddress.text = pref.ipAddress 133 | portNumber.text = pref.portNumber.toString() 134 | } 135 | 136 | companion object { 137 | 138 | fun newInstance(): FloatingMenuFragment { 139 | return FloatingMenuFragment() 140 | } 141 | } 142 | 143 | 144 | } 145 | 146 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/ui/InfoActivity.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.ui 2 | 3 | import android.content.Intent 4 | import android.graphics.drawable.ColorDrawable 5 | import android.os.Build 6 | import android.support.annotation.RequiresApi 7 | import android.support.v7.app.AppCompatActivity 8 | import android.os.Bundle 9 | import android.widget.EditText 10 | import android.widget.Toast 11 | 12 | import com.tofaha.Android_wifi.Pref 13 | import com.tofaha.Android_wifi.R 14 | import com.tofaha.Android_wifi.Util 15 | import com.tofaha.Android_wifi.app.TofahaApplication 16 | 17 | import javax.inject.Inject 18 | 19 | import butterknife.BindView 20 | import butterknife.ButterKnife 21 | import butterknife.OnClick 22 | import com.tofaha.Android_wifi.ui.main.MainActivity 23 | 24 | class InfoActivity : AppCompatActivity() { 25 | 26 | @BindView(R.id.ip_address) 27 | lateinit var ipAddress: EditText 28 | 29 | @BindView(R.id.port_number) 30 | lateinit var portNumber: EditText 31 | 32 | @Inject 33 | lateinit var pref: Pref 34 | 35 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) 36 | override fun onCreate(savedInstanceState: Bundle?) { 37 | super.onCreate(savedInstanceState) 38 | setContentView(R.layout.activity_main2) 39 | 40 | (this.application as TofahaApplication).getAppComponent()!!.inject(this) 41 | 42 | ButterKnife.bind(this) 43 | 44 | supportActionBar!!.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.blue_menu))) 45 | window.statusBarColor = resources.getColor(R.color.blue_menu) 46 | 47 | if (Util.isValidIp(pref!!.ipAddress!!) && pref!!.portNumber != 0) { 48 | startMainActivity() 49 | } 50 | } 51 | 52 | @OnClick(R.id.login_next) 53 | fun next() { 54 | 55 | if (Util.isValidIp(ipAddress!!.text.toString())) { 56 | pref!!.ipAddress = ipAddress!!.text.toString() 57 | } else { 58 | Toast.makeText(this, "Enter valid IP address", Toast.LENGTH_SHORT).show() 59 | return 60 | } 61 | 62 | if (portNumber!!.text.toString() != "") { 63 | pref!!.portNumber = Integer.parseInt(portNumber!!.text.toString()) 64 | } else { 65 | Toast.makeText(this, "Enter port number", Toast.LENGTH_SHORT).show() 66 | return 67 | } 68 | 69 | startMainActivity() 70 | } 71 | 72 | fun startMainActivity() { 73 | val intent = Intent(this@InfoActivity, MainActivity::class.java) 74 | intent.flags = (Intent.FLAG_ACTIVITY_CLEAR_TASK 75 | or Intent.FLAG_ACTIVITY_CLEAR_TOP 76 | or Intent.FLAG_ACTIVITY_NEW_TASK) 77 | startActivity(intent) 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/ui/main/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.ui.main 2 | 3 | import android.graphics.drawable.ColorDrawable 4 | import android.os.* 5 | import android.support.v7.app.AppCompatActivity 6 | import android.support.annotation.RequiresApi 7 | import android.widget.EditText 8 | import android.widget.TextView 9 | import butterknife.BindView 10 | import butterknife.ButterKnife 11 | import butterknife.OnClick 12 | import com.tofaha.Android_wifi.Pref 13 | import com.tofaha.Android_wifi.R 14 | import com.tofaha.Android_wifi.app.MyData 15 | import com.tofaha.Android_wifi.app.TofahaApplication 16 | import com.tofaha.Android_wifi.connection.CLoseConnection 17 | import com.tofaha.Android_wifi.connection.OpenConnection 18 | import com.tofaha.Android_wifi.connection.SendMessages 19 | import com.tofaha.Android_wifi.ui.FloatingMenuFragment 20 | import kotlinx.android.synthetic.main.activity_main.* 21 | import org.jetbrains.anko.doAsync 22 | import org.jetbrains.anko.uiThread 23 | import java.io.* 24 | import javax.inject.Inject 25 | 26 | class MainActivity : AppCompatActivity() , MainView { 27 | 28 | 29 | var input: BufferedReader? = null 30 | 31 | @Inject 32 | lateinit var pref: Pref 33 | 34 | @BindView(R.id.text_message) 35 | lateinit var msgText : EditText 36 | 37 | @BindView(R.id.server_response) 38 | lateinit var serverResponse : TextView 39 | 40 | @RequiresApi(Build.VERSION_CODES.LOLLIPOP) 41 | override fun onCreate(savedInstanceState: Bundle?) { 42 | super.onCreate(savedInstanceState) 43 | setContentView(R.layout.activity_main) 44 | 45 | (this.application as TofahaApplication).getAppComponent()!!.inject(this) 46 | 47 | ButterKnife.bind(this) 48 | 49 | MyData.mainActivity = this 50 | 51 | supportActionBar!!.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.blue_menu))) 52 | window.statusBarColor = resources.getColor(R.color.blue_menu) 53 | 54 | this.fab.bringToFront() 55 | this.fab.parent.requestLayout() 56 | 57 | led1.setOnClickListener({ 58 | var m : String 59 | if (led1.isChecked) 60 | m = "pin=11" 61 | else 62 | m = "pin=01" 63 | sendMessage(m) 64 | }) 65 | 66 | led2.setOnClickListener({ 67 | var m : String 68 | if (led2.isChecked) 69 | m = "pin=22" 70 | else 71 | m = "pin=02" 72 | sendMessage(m) 73 | }) 74 | 75 | refresh_connection.setOnClickListener({ 76 | openConnection() 77 | }) 78 | 79 | } 80 | 81 | 82 | @OnClick(R.id.fab) 83 | operator fun next() { 84 | var dialogFrag = FloatingMenuFragment.newInstance() 85 | dialogFrag.setParentFab(fab) 86 | dialogFrag.show(getSupportFragmentManager(), dialogFrag.getTag()) 87 | } 88 | 89 | @OnClick(R.id.send_message) 90 | fun sendButton(){ 91 | sendMessage(msgText.text.toString()) 92 | } 93 | 94 | override fun sendMessage(msg : String) { 95 | var sendMessages = SendMessages(msg) 96 | sendMessages!!.execute() 97 | } 98 | 99 | override fun openConnection() { 100 | var openConnection = OpenConnection(pref.ipAddress!!, pref.portNumber) 101 | openConnection!!.execute() 102 | } 103 | 104 | override fun receiveMessage() { 105 | doAsync { 106 | 107 | input = BufferedReader(InputStreamReader(MyData.socket.getInputStream())) 108 | var msgText = "waiting ...." 109 | MyData.THREAD_RUNNING = true 110 | 111 | while (true) { 112 | 113 | //println(input?.readLine()) 114 | Thread.sleep(300) 115 | msgText = input?.readLine().toString() 116 | 117 | uiThread { 118 | serverResponse.text = msgText 119 | } 120 | } 121 | } 122 | } 123 | 124 | override fun closeConnection() { 125 | var closeConnection = CLoseConnection() 126 | closeConnection!!.execute() 127 | } 128 | 129 | 130 | override fun onResume() { 131 | super.onResume() 132 | openConnection() 133 | } 134 | 135 | override fun onPause() { 136 | super.onPause() 137 | closeConnection() 138 | } 139 | 140 | } 141 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/java/com/tofaha/Android_wifi/ui/main/MainView.kt: -------------------------------------------------------------------------------- 1 | package com.tofaha.Android_wifi.ui.main 2 | 3 | /** 4 | * Created by ayoub on 11/30/17. 5 | */ 6 | interface MainView { 7 | fun openConnection() 8 | fun closeConnection() 9 | fun sendMessage(msg : String) 10 | fun receiveMessage() 11 | } -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/code_source_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/code_source_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/ic_action_ip_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/ic_action_ip_logo.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/port_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/port_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/refresh_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/refresh_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/send_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/send_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-hdpi/share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-hdpi/share_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/code_source_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/code_source_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/ic_action_ip_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/ic_action_ip_logo.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/port_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/port_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/refresh_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/refresh_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/send_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/send_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-mdpi/share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-mdpi/share_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/code_source_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/code_source_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/ic_action_ip_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/ic_action_ip_logo.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/port_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/port_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/refresh_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/refresh_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/send_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/send_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xhdpi/share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xhdpi/share_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/code_source_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/code_source_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/ic_action_ip_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/ic_action_ip_logo.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/port_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/port_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/refresh_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/refresh_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/send_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/send_blue.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable-xxhdpi/share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable-xxhdpi/share_white.png -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/btn_accent_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/btn_blue_menu_button_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/btn_blue_menu_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/btn_blue_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/btn_transparent_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/esp8266.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayoubElhoucine/Connect-Android-to-Arduino-via-Wifi/e1817a94ca8068837fcdd2e266fdec908a933a79/Android_Wifi/app/src/main/res/drawable/esp8266.jpg -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/ic_filter.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/layout/activity_app_source_code.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 19 | 20 | 30 | 31 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 19 | 20 | 30 | 31 | 38 | 39 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 69 | 70 | 76 | 77 | 85 | 86 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 110 | 111 | 116 | 117 | 125 | 126 | 132 | 133 | 142 | 143 | 152 | 153 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 176 | 177 | 178 | 181 | 182 | 187 | 188 | 197 | 198 | 204 | 205 | 213 | 214 | 215 | 216 | 217 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /Android_Wifi/app/src/main/res/layout/activity_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 18 | 27 | 28 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 56 | 57 | 62 | 63 | 73 | 74 | 85 | 86 |