This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | |
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:2.1.0' | |
| classpath 'me.tatarka:gradle-retrolambda:3.3.1' | |
| classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Socket socket= null; | |
| @Override | |
| public void onCreate(Bundle savedInstanceState){ | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| try{ | |
| socket = IO.socket("http://192.168.0.101:3000"); | |
| socket.connect(); | |
| socket.on("message", handleIncomingMessages); | |
| }catch(URISyntaxException e){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://github.com/sreejesh79/android-socket.io-client-demo/tree/master/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <android.support.design.widget.CoordinatorLayout 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" | |
| android:fitsSystemWindows="true"> | |
| <android.support.design.widget.AppBarLayout | |
| android:id="@+id/app_bar" | |
| android:layout_width="match_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| compile 'com.google.code.gson:gson:2.6.2' | |
| compile 'com.squareup.retrofit2:retrofit:2.1.0' | |
| public interface ApiService { | |
| @NonNull | |
| private RequestBody createPartFromString(String descriptionString) { | |
| return RequestBody.create( | |
| MediaType.parse(MULTIPART_FORM_DATA), descriptionString); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class RealPathUtils { | |
| @SuppressLint("NewApi") | |
| public static String getRealPathFromURI_API19(Context context, Uri uri){ | |
| String filePath = ""; | |
| String wholeID = DocumentsContract.getDocumentId(uri); | |
| // Split at colon, use second item in the array | |
| String id = wholeID.split(":")[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.kgisl.sharetruck.hub.util; | |
| /** | |
| * Created by admin on 14-03-2017. | |
| */ | |
| import android.app.Activity; | |
| import android.app.AlertDialog; | |
| import android.content.DialogInterface; | |
| import android.content.Intent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.kgisl.sharetruck.hub.ui.adapter; | |
| import android.content.Context; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.TextView; | |
| import com.kgisl.sharetruck.hub.R; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //copy your map_activity.xml in layout folder | |
| <fragment | |
| android:id="@+id/map" | |
| android:name="com.google.android.gms.maps.SupportMapFragment" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" /> | |
| public class MapActivity extends AppCompatActivity implements OnMapReadyCallback { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.kgisl.sharetruck.hub.util; | |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.os.Build; | |
| import android.renderscript.Allocation; | |
| import android.renderscript.Element; | |
| import android.renderscript.RenderScript; | |
| import android.renderscript.ScriptIntrinsicBlur; | |
| import android.support.annotation.RequiresApi; |