Sei sulla pagina 1di 6

5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

HOME LATEST  DOWNLOAD  KODULAR APP ANDROID STUDIO APP B

Home  Android Studio Source Code

Create Pdf Book App in Android Studio


|| Download Free Pdf Book Source Code
 MySpecial Tech Support  April 11, 2020  1 Comments

  Facebook  Twitter   

दो इस Post म हम Android Studio पर PDF Book App बनाना सीखगे PDF Book App बनाने के लए
नीचे दी गई वी डयो को Complete देखे

Download Source Code Click Here 

Step 1-Activity_main.xml File

<?xml version="1.0" encoding="utf-8"?>

https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 1/6
5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

   <Button
    android:id="@+id/study1"
    android:layout_width="330dp"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_alignParentEnd="true"
    android:layout_marginStart="40dp"
    android:layout_marginTop="20dp"
    android:layout_marginEnd="40dp"
    android:text="Study 1"
    android:textStyle="bold"
    android:textColor="@android:color/white"
    android:background="@drawable/rounded_corner"/>

   <Button
       android:id="@+id/study2"
       android:layout_width="330dp"
       android:layout_height="wrap_content"
       android:layout_alignParentStart="true"
       android:layout_alignParentEnd="true"
       android:layout_marginStart="40dp"
       android:layout_marginTop="80dp"
       android:layout_marginEnd="40dp"
       android:text="Study 2"
       android:textStyle="bold"
       android:textColor="@android:color/white"
       android:background="@drawable/rounded_corner"/>

   <Button
       android:id="@+id/study3"
       android:layout_width="330dp"
       android:layout_height="wrap_content"
       android:layout_alignParentStart="true"
       android:layout_alignParentEnd="true"
       android:layout_marginStart="40dp"
       android:layout_marginTop="140dp"
       android:layout_marginEnd="40dp"
       android:text="Study 3"
       android:textStyle="bold"
       android:textColor="@android:color/white"
       android:background="@drawable/rounded_corner"/>

</RelativeLayout>

https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 2/6
5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

Step-2 rounded_corner.xml file

<?xml version="1.0" encoding="utf-8"?>


<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">

    <corners android:radius="50dp"/>
    <solid android:color="#009688"/>
</shape>

Step-3 MainActivity.Java File

public class MainActivity extends AppCompatActivity {

    Button study1;
    Button study2;
    Button study3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        study1 = (Button) findViewById(R.id.study1);


        study1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,Study1Activity.class);
                startActivity(intent);

      }
        });

        study2 = (Button) findViewById(R.id.study2);


        study2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,Study2Activity.class);
                startActivity(intent);

      }
        });

        study3 = (Button) findViewById(R.id.study3);

https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 3/6
5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

        study3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,Study3Activity.class);
                startActivity(intent);

      }
        });
  }
}

Step-4  Add Dependency

implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'

Step-5 Activity_study1.xml file,Activity_study2.xml file And Activity_study3.xml file

<com.github.barteksc.pdfviewer.PDFView
        android:id="@+id/pdfView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

Step 6-Study1Activity.Java file

public class Study1Activity extends AppCompatActivity {

    PDFView study1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_study1);

        study1=(PDFView) findViewById(R.id.pdfView1);
        study1.fromAsset("part1.pdf").load();
  }
}

Step 7-Study2Activity.Java file

public class Study2Activity extends AppCompatActivity {

    PDFView study2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_study2);

https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 4/6
5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

        study2=(PDFView) findViewById(R.id.pdfView2);
        study2.fromAsset("part2.pdf").load();
  }
}

Step 8-Study3Activity.Java file

public class Study3Activity extends AppCompatActivity {

    PDFView study3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_study3);

        study3=(PDFView) findViewById(R.id.pdfView3);
        study3.fromAsset("part3.pdf").load();
  }
}

Tags Android Studio Source Code

  Facebook  Twitter   

You might like Show more

Create Pdf Book App in Android Sourse Code


Android Studio || Download  April 01, 2020
Free Pdf Book Source Code
 April 11, 2020

1 Comments

Rajputana 24 April 2020 at 11:48

Jmj hkm
https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 5/6
5/31/2020 Create Pdf Book App in Android Studio || Download Free Pdf Book Source Code

Reply

Enter your comment...

Comment as: Google Accoun

Publish Preview

 Previous Post Next Post 

ABOUT US

नम ार दो , म मोहन सह आपका ब त ब त ागत करता ँ हमारे “My


Special Tech Support” ॉग म,

Home Disclaimer Contact


Created By || My Special Tech Support || Mohan Singh

https://www.myspecialtechsupport.online/2020/04/create-pdf-book-app-in-android-studio.html 6/6

Potrebbero piacerti anche