Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:21:09+00:00 2026-06-17T23:21:09+00:00

I want to create a program, that open documents without external app. I need

  • 0

I want to create a program, that open documents without external app. I need this, because i want to scroll the document with the phones orientation(Pitch and Roll). I create a button on the bottom of the screen, and when i hold down the button, i can scroll the document too. If i release the button, i can’t scroll it. So, if i open the document with external app, my button disappears, and the sensorManager works neither.

Have someone any idea to solve this problem. Or have someone any idea, how to scroll the document, opened in an external app, with my phones orientation?

(Sorry for my English)

This is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.orientationscrolling"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.orientationscrolling.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
</manifest>

This is my Layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    android:orientation="vertical" >

<Button 
   android:id="@+id/mybutt"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="25sp"
   android:text="Scroll!!"
   android:layout_gravity="right"/>
</LinearLayout>

This is my Code:

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    button = (Button) findViewById( R.id.mybutt );

    String pdf = "http://www.pc-hardware.hu/PDF/konfig.pdf";
    String doc="<iframe src='http://docs.google.com/gview?embedded=true&url=http://www.pc-hardware.hu/PDF/konfig.pdf' width='100%' height='100%' style='border: none;'></iframe>";
    webView = (WebView) findViewById(R.id.webView1);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setPluginsEnabled(true);
    webView.getSettings().setAllowFileAccess(true);
    webView.loadData( doc , "text/html", "UTF-8");
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:21:10+00:00Added an answer on June 17, 2026 at 11:21 pm

    I think you should use custom library for getting that done .See this and this

    But there is a way for displaying PDF with out calling another application

    This is a way for showing PDF in android app that is embedding the PDF document to android webview using support from http://docs.google.com/viewer

    pseudo

    String doc="<iframe src='http://docs.google.com/viewer?url=+location to your PDF File+' 
                  width='100%' height='100%' 
                  style='border: none;'></iframe>";
    

    a sample is is shown below

     String doc="<iframe src='http://docs.google.com/viewer?url=http://www.iasted.org/conferences/formatting/presentations-tips.ppt&embedded=true' 
                  width='100%' height='100%' 
                  style='border: none;'></iframe>";
    

    Code

        WebView  wv = (WebView)findViewById(R.id.webView); 
        wv.getSettings().setJavaScriptEnabled(true);
        wv.getSettings().setPluginsEnabled(true);
        wv.getSettings().setAllowFileAccess(true);
        wv.loadUrl(doc);
        //wv.loadData( doc, "text/html",  "UTF-8");
    

    and in manifest provide

    <uses-permission android:name="android.permission.INTERNET"/>
    

    See this

    Caution : I am not aware of compatibility issues with various android versions

    In this approach the drawback is you need internet connectivity . But i think it satisfy your need

    EDIT
    Try this as src for iframe

    src="http://docs.google.com/gview?embedded=true&url=http://www.pc-hardware.hu/PDF/konfig.pdf"
    

    try wv.loadData( doc , "text/html", "UTF-8"); . Both works for me

    enter image description hereenter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create an extremely simple iPhone program that will open a telnet
I want to create a program that produces an executable slideshow. So I need
I want to create a companion Windows desktop program for my app. One that
I want to create a small program in C# in Windows that would open
I want to create a simple program that you open any given image and
I want to create a program that runs on iPads, Playbooks, and Windows computers
I want to create a MSWindows Python program that would launch a new Firefox
I created one GWT webapplication project.Inthat i want to create servlet program,but in that
I want a program that would help me create virtual devices on a virtual
I want to create a program that stream the screen of my Mac to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.