Friday, December 25, 2020

add RestError.java

 package network;


import com.google.gson.annotations.Expose;

import com.google.gson.annotations.SerializedName;


public class RestError

{

    private boolean error;


    @SerializedName("status")

    @Expose

    private Integer status;

    @SerializedName("message")

    @Expose

    private String message;


    public RestError(String message) {

        this.message = message;

    }


    public boolean isError() {

        return error;

    }


    public void setError(boolean error) {

        this.error = error;

    }


    public String getMessage() {

        return message;

    }


    public void setMessage(String message) {

        this.message = message;

    }


}


add interface ApiInterface

 package network;


import retrofit2.Call;

import retrofit2.http.Body;

import retrofit2.http.Headers;

import retrofit2.http.POST;

import retrofit2.http.Query;


public interface ApiInterface

{

    String GET_CAT="readc.php";


   @Headers({"Content-Type: application/json","Accept: application/json"})

    @POST(GET_CAT)

    Call<contact> getdata();



}


Add StringConverter.java

 package network;



import androidx.annotation.NonNull;


import java.io.IOException;

import java.lang.annotation.Annotation;

import java.lang.reflect.Type;


import okhttp3.MediaType;

import okhttp3.RequestBody;

import okhttp3.ResponseBody;

import retrofit2.Converter;

import retrofit2.Retrofit;


class StringConverter extends Converter.Factory

{

    private static final MediaType MEDIA_TYPE = MediaType.parse("text/plain");

    @Override

    public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {

        if (String.class.equals(type)) {

            return new Converter<ResponseBody, String>() {

                @Override

                public String convert(@NonNull ResponseBody value) throws IOException {

                    return value.string();

                }

            };

        }

        return null;

    }


    @Override

    public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations,

                                                          Annotation[] methodAnnotations, Retrofit retrofit) {


        if (String.class.equals(type)) {

            return new Converter<String, RequestBody>() {

                @Override

                public RequestBody convert(@NonNull String value) throws IOException {

                    return RequestBody.create(MEDIA_TYPE, value);

                }

            };

        }

        return null;

    }


}


Add TLSSocketFactory.java

 package network;


import java.io.IOException;

import java.net.InetAddress;

import java.net.Socket;

import java.security.KeyManagementException;

import java.security.NoSuchAlgorithmException;


import javax.net.ssl.SSLContext;

import javax.net.ssl.SSLSocket;

import javax.net.ssl.SSLSocketFactory;


class TLSSocketFactory extends SSLSocketFactory

{

    private SSLSocketFactory delegate;


    public TLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException {

        SSLContext context = SSLContext.getInstance("TLS");

        context.init(null, null, null);

        delegate = context.getSocketFactory();

    }


    @Override

    public String[] getDefaultCipherSuites() {

        return delegate.getDefaultCipherSuites();

    }


    @Override

    public String[] getSupportedCipherSuites() {

        return delegate.getSupportedCipherSuites();

    }


    @Override

    public Socket createSocket() throws IOException {

        return enableTLSOnSocket(delegate.createSocket());

    }


    @Override

    public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {

        return enableTLSOnSocket(delegate.createSocket(s, host, port, autoClose));

    }


    @Override

    public Socket createSocket(String host, int port) throws IOException {

        return enableTLSOnSocket(delegate.createSocket(host, port));

    }


    @Override

    public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {

        return enableTLSOnSocket(delegate.createSocket(host, port, localHost, localPort));

    }


    @Override

    public Socket createSocket(InetAddress host, int port) throws IOException {

        return enableTLSOnSocket(delegate.createSocket(host, port));

    }


    @Override

    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {

        return enableTLSOnSocket(delegate.createSocket(address, port, localAddress, localPort));

    }


    private Socket enableTLSOnSocket(Socket socket) {

        if (socket != null && (socket instanceof SSLSocket)) {

            ((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"});

        }

        return socket;

    }


}


get data from Api Using Retrofit2 ApiClient.java

package network;


import java.security.KeyManagementException;

import java.security.NoSuchAlgorithmException;

import java.util.concurrent.TimeUnit;


import okhttp3.OkHttpClient;

import okhttp3.logging.HttpLoggingInterceptor;

import retrofit2.Retrofit;

import retrofit2.converter.gson.GsonConverterFactory;

import retrofit2.converter.scalars.ScalarsConverterFactory;



public class ApiClient

{

    private static final String BASE_URL="http://www.gkmaza.com/apps/gujarati_suvichar/";

    private static Retrofit retrofit=null;

    private static OkHttpClient client;

    public static Retrofit getClient()

    {

        if(retrofit==null)

        {

            HttpLoggingInterceptor interceptor=new HttpLoggingInterceptor();

            interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

            try

            {

                client = new OkHttpClient.Builder()

                        .followRedirects(true)

                        .followSslRedirects(true)

                        .sslSocketFactory(new TLSSocketFactory())

                        .retryOnConnectionFailure(true)

                        .addInterceptor(interceptor)

                        .connectTimeout(30, TimeUnit.MINUTES)

                        .readTimeout(30, TimeUnit.MINUTES)

                        .addInterceptor(interceptor)

                        .build();


            }catch (KeyManagementException e)

            {

                e.printStackTrace();

            }catch (NoSuchAlgorithmException e)

            {

                e.printStackTrace();

            }

            retrofit=new Retrofit.Builder()

                    .baseUrl(BASE_URL)

                    .client(client)

                    .addConverterFactory(new StringConverter())

                    .addConverterFactory(ScalarsConverterFactory.create())

                    .addConverterFactory(GsonConverterFactory.create())

                    .build();


        }


        return retrofit;

    }

}

 

Thursday, November 19, 2020

PREMIUM Quotes App With Android Studio And Admob Ads

 


Quotes App Is An Android Application.Quotes App Has User-Friendly Interface With Easy To Manage. The Quote App Or Sayari App Are Stored In Firebase For Easy Editing And Better Performance.

Best Quotes App Is An Android Application. Quotes App Has User-Friendly Interface With Easy To Manage. The Quotes App Are Stored In Firebase For Easy Editing And Better Performance. Sayari App In Android Studio With Admob Ads And Firebase Realtime Database.



Premium Quotes APP

Only Rs. 499/-

Features


Android Side

  • Quotes With Category Wise
  • Latest Quotes
  • Copy or Share Quote with your friends and on Social Networks
  • Share Image with Quotes
  • Add to Favorite Mode
  • Latest UI with Material Design
  • Admob with Banner and Interstitial ads Integrated
  • App comply with GDPR
  • You can also change frequency on interstitial ad to show after number of click
  • Firebase Analytics
  • Easy Admin Panel – Firebase Backend
  • All Device Combability
  • Check Network Availability
  • MultiLanguage Supported (if your phone supports particular language)
  • Android Code Migrated to AndroidX
  • Android Studio Code (Recommended Android Studio Version – 3.3)


Admin Side

  1. Simple Admin Panel
  2. Easily Add Category
  3. Easily Add Quotes
  4. Quote of the day
  5. Edit and Delete Quotes, Author and Category
  6. Upload Unlimited Category and Quote
  7. Firebase Backend

What You Get:


  1. Full Android Source Code
  2. Full PHP Code of Server Side
  3. Document with Screen Shot
  • App Features
  • Amazing Swiping Cards View
  • Share As Screenshots With Branding
  • Swipe Right Save To Read Offline
  • Supports Video Embeds
  • Supports HTML tags & Links
  • Latest Admob Integrated
  • App Tour With How To Use App
  • Multi language Support
  • Post By Language And Categories
  • OneSignal Push Notifications
  • Easy To Make App In Minutes



Saturday, October 7, 2017

Facts About ISRO | Creating A World Record | Indian Space Research Organisation | gkmaza |

 Hey Guys, in this video I have told you some facts on ISRO. ISRO is well known for its economical and successful missions. ISRO (Indian Space Research Organization) is one of the top space organization which runs on a very little budget. But the work done and the success achieved by ISRO in limited resources is remarkable. In this video I tried to explain the basic main facts about ISRO but there is more about ISRO as it growing everyday with very new concept of technology which will be beneficial for INDIA and world. It is hard work of scientist at ISRO which led it to the this position in the world ranking. Also it received criticism for the launching of Mars Orbiter Mission, I always wonder why these critics space technology ignore the fact that how space technology has made huge difference in human lives. Just take a example of your Electronic chips in the phone,scratch resistance screen.and many more, if space technology wasn't there god knows when these things would have invented Hope you enjoy the video and if you enjoyed make sure to LIKE, SHARE And SUBSCRIBE !!!!!!

-know about genrel knowledge to visit www.gkmaza.com