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
| <?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 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 MyHandlers { | |
| public void btnClick(View view, User user) { | |
| Toast.makeText(view.getContext(),"Name: "+user.getName() , Toast.LENGTH_LONG).show(); | |
| } | |
| } |
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
| <resources> | |
| ... | |
| <string name="admob_app_id">ca-app-pub-3940256099942544~3347511713</string> | |
| <string name="ad_unit_id">ca-app-pub-3940256099942544/5224354917</string> | |
| ... | |
| </resources> |
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 CustomAdapter extends RecyclerView.Adapter<CustomAdapter.CustomViewHolder> { | |
| private List<RetroPhoto> dataList; | |
| private Context context; | |
| public CustomAdapter(Context context,List<RetroPhoto> dataList){ | |
| this.context = context; | |
| this.dataList = dataList; | |
| } |
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
| private void startCameraSource() { | |
| //Create the TextRecognizer | |
| final TextRecognizer textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build(); | |
| if (!textRecognizer.isOperational()) { | |
| Log.w(TAG, "Detector dependencies not loaded yet"); | |
| } else { | |
| //Initialize camerasource to use high resolution and set Autofocus on. |
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 interface GetDataService { | |
| @GET("/photos") | |
| Call<List<RetroPhoto>> getAllPhotos(); | |
| } |
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 MainActivity extends AppCompatActivity { | |
| private User user; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); | |
| user = new User(); | |
| user.setName("Prakash"); | |
| user.setEmail("praks@email.com"); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <data> | |
| <variable | |
| name="user" | |
| type="com.tuts.prakash.databinding.model.User" /> | |
| <variable name="handler" | |
| type="com.tuts.prakash.databinding.handlers.MyHandlers"/> | |
| </data> |
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 User { | |
| private String name; | |
| private String email; | |
| public String getName() { | |
| return name; | |
| } | |
| public void setName(String name) { | |
| this.name = name; |
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 { | |
| dataBinding { | |
| enabled = true | |
| } | |
| compileSdkVersion 27 | |
| . | |
| . | |
| . | |
| } |
NewerOlder