Dart Flutter Tutorial

By // No comments:
1. Install the plugin
2. Search plugin flutter

3. Start a new flutter project

4.Select the flutter Application 

5.Select the SDK Path



                                                                                                                                 




Retrofit Tutorial in Android

By // No comments:
1. What is Retrofit?

Retrofit is a REST Client library Helper library used in android and java to create an HTTP  request
and also process the HTTP  response from a REST API.


2. Create an Interface Class.

   public interface endpointservice {
         
      // GET AND SET two method use to depend on you.
     // put the endpoint file name in GET("") . that means the last name of the base URL

     @GET("users.php")

    // first my module convert the list then get the value by listresponse()

     Call<List<mymodule> listresponse(@Field("User_name"),String name)

}

3. Create the Instance Class.

 public class myretrofitInstance{
     public final String BASE_URL = "https://example.com/fruit";

Retrofit retrofit = new Retrofit.Builder().baseUrl(BASE_URL )
.addConverterFactory(GsonConverterFactory.create()).build();



}

4. Now Final MainActivity class

// service is initialization in this class

// first initialization instance class.
// second store creates service in the service variable.
// then call the method which is created in service class and pass the parameter.
// now the last process call the enqueue method which is inside two methods 1. onResponse 2. onFailure
// MainActivity

public myretrofitInstance adbs;
 endpointservice  andpoint = adbs.create(endpointservice .class);


Call<mymodule> call  =  andpoint.listresponse("API_KEY");

call.enqueue(new Callback<mymodule>(){

@Override
public void onResponse(Call<mymodule> call,Response<mymodule> response)
{
List<mymodule> mymodule = response.body.getResult();
recyclerview.setAdapter(new MyAdapter(mymodule,R.layout.list_item_movie,getApplicationContext()));

}

@Override
public void onFailure(Call<mymodule> call, Throwable throwable)
{
Log.e(TAG, throwable.tostring());
}

});


5. dependencies


compile fileTree(dir: ‘libs’, include: [‘*.jar’])
testCompile ‘junit:junit:4.12’
compile ‘com.android.support:appcompat-v7:23.3.0’
// retrofit, gson
compile ‘com.squareup.picasso:picasso:2.5.2’
compile ‘com.squareup.retrofit2:retrofit:2.1.0’
compile ‘com.squareup.retrofit2:converter-gson:2.1.0’
compile ‘com.android.support:recyclerview-v7:25.0.0’



Navigation Drawer

By // No comments:
This is the sidebar . and also called the Navigation Drawer. two buttons are created first is false and second is true then different data display in the navigation bar
















// first  two onclick listeners create than called the two method different parameters

// two methods initialization



https://github.com/popnitesh/Navigationbar
Powered by Blogger.