This file contains 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 RetrofitClientInstance { | |
private static Retrofit retrofit; | |
private static final String BASE_URL = "https://jsonplaceholder.typicode.com"; | |
public static Retrofit getRetrofitInstance() { | |
if (retrofit == null) { | |
retrofit = new retrofit2.Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) |
This file contains 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 MainActivity extends AppCompatActivity { | |
private CustomAdapter adapter; | |
private RecyclerView recyclerView; | |
ProgressDialog progressDoalog; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains 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 RetroPhoto { | |
@SerializedName("albumId") | |
private Integer albumId; | |
@SerializedName("id") | |
private Integer id; | |
@SerializedName("title") | |
private String title; | |
@SerializedName("url") | |
private String url; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tuts.prakash.retrofittutorial"> | |
<!--Internet Permission--> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" |
This file contains 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
dependencies { | |
... | |
compile "com.android.support:cardview-v7:26.1.0" | |
compile 'com.android.support:recyclerview-v7:26.1.0' | |
compile 'com.squareup.picasso:picasso:2.5.2' | |
compile 'com.squareup.retrofit2:retrofit:2.3.0' | |
compile 'com.squareup.retrofit2:converter-gson:2.3.0' | |
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' |
This file contains 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
dependencies { | |
... | |
compile 'com.google.android.gms:play-services-vision:11.0.4' | |
... | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tuts.prakash.simpleocr"> | |
<uses-permission android:name="android.permission.CAMERA"/> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:weightSum="5" | |
tools:context="com.tuts.prakash.simpleocr.MainActivity"> | |
<SurfaceView | |
android:id="@+id/surfaceView" |
This file contains 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
mCameraSource = new CameraSource.Builder(getApplicationContext(), textRecognizer) | |
.setFacing(CameraSource.CAMERA_FACING_BACK) | |
.setRequestedPreviewSize(1280, 1024) | |
.setAutoFocusEnabled(true) | |
.setRequestedFps(2.0f) | |
.build(); |
This file contains 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
textRecognizer.setProcessor(new Detector.Processor<TextBlock>() { | |
@Override | |
public void release() { | |
} | |
/** | |
* Detect all the text from camera using TextBlock and the save values into a stringBuilder | |
* which will then be set to the textView. | |
* */ | |
@Override |
OlderNewer