Posts

Showing posts from July, 2020

ads

private InterstitialAd interstitialAd ; private com.google.android.gms.ads.InterstitialAd mInterstitialAd ; onCreate MobileAds. initialize (getActivity(), new OnInitializationCompleteListener() { @Override public void onInitializationComplete(InitializationStatus initializationStatus) {} }); mInterstitialAd = new com.google.android.gms.ads.InterstitialAd(getActivity()); mInterstitialAd .setAdUnitId( "ca-app-pub-3744018609707534/3930596177" ); mInterstitialAd .loadAd( new AdRequest.Builder().build()); onclick StartAppAd. showAd (getActivity()); showAdWithDelay(); private void setfbInter() { interstitialAd = new InterstitialAd(getActivity(), getString(R.string. interstitial_placement ));          for load add // load the ad interstitialAd .loadAd(); } private void showAdWithDelay() { /** * Here is an example for displaying the ad with delay; * Please do not copy the Handler into your project */ // Handler handler = ...

logi coda

import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation. Nullable ; import androidx.appcompat.app.AppCompatActivity; public class Login extends AppCompatActivit { Button reg ; Button login ; TextView em , ps ; String eid , pass ; SQLiteDatabase db ; @Override protected void onCreate( @Nullable Bundle savedInstanceState) { super .onCreate( savedInstanceState ); setContentView( R.layout. login ); db = openOrCreateDatabase( "my.db" , MODE_PRIVATE, null ); db .execSQL( "create table if not exists user(id integer primary key autoincrement,uname text,phone text,dob text,email text,pass text, gender text,city text)" ); reg = findViewById( R.id. reg ); login = findViewById( R.id....

regpage

xml coda: <? xml version ="1.0" encoding ="utf-8" ?> < ScrollView xmlns: android ="http://schemas.android.com/apk/res/android" android :layout_width ="match_parent" android :layout_height ="match_parent" android :orientation ="vertical" > < LinearLayout xmlns: android ="http://schemas.android.com/apk/res/android" android :layout_width ="match_parent" android :layout_height ="match_parent" android :orientation ="vertical" > < TextView android :id ="@+id/tv" android :layout_width ="match_parent" android :layout_height ="wrap_content" android :layout_margin ="10dp" android :background ="@drawable/boder" android :gravity ="center" android :text ="register" andr...

normal RecyclerView.Adapter

     import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation. NonNull ; import androidx.recyclerview.widget.RecyclerView; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.Random; public class CustemAdapter extends RecyclerView.Adapter<CustemAdapter.VID> { ArrayList<ItemObject> stringArrayList ; Context context ; public CustemAdapter(ArrayList<ItemObject> stringArrayList, Context context) { this . stringArrayList = stringArrayList; this . context = context; } @NonNull @Override public VID onCreateViewHolder( @NonNull ViewGroup parent, int viewType) { View view= LayoutInflater. from ( context ).inflate(R.layout. itemfile ,parent, false ); return new VID(view); } @Overr...

endless RecyclerView Adapter

File name:  EndlessRecyclerViewScrollListener import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.StaggeredGridLayoutManager; public abstract class EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener { // The minimum amount of items to have below your current scroll position // before loading more. private int visibleThreshold = 2 ; // The current offset index of data you have loaded private int currentPage = 0 ; // The total number of items in the dataset after the last load private int previousTotalItemCount = 0 ; // True if we are still waiting for the last set of data to load. private boolean loading = true ; // Sets the starting page index private int startingPageIndex = 0 ; RecyclerView.LayoutManager mLayoutManager ; public EndlessRecyclerViewScrollListener(Line...