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

  • SEARCH
  • Home
  • 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 9221557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:36:19+00:00 2026-06-18T03:36:19+00:00

I trying this code but i always show the error Permission Denied.and i try

  • 0

I trying this code but i always show the error Permission Denied.and i try code in below.

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hope.project"
    android:versionCode="1"
    android:versionName="1.0">
     <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />

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

      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
      <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
      <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>

    <application android:label="@string/app_name"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/AppTheme">

         <activity android:name="com.hope.project.MainActivity" android:label="@string/app_name"
                android:theme="@android:style/Theme.Black.NoTitleBar"
                android:configChanges="keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>

and i display in error:

 01-25 17:24:17.853: DEBUG/szipinf(12612): Initializing inflate state
01-25 17:24:17.853: DEBUG/szipinf(12612): Initializing zlib to inflate
01-25 17:24:19.201: DEBUG/dalvikvm(338): GC_EXPLICIT freed 17K, 5% free 6276K/6599K, paused 3ms+115ms
01-25 17:24:25.424: DEBUG/dalvikvm(206): GC_EXPLICIT freed 153K, 6% free 6730K/7111K, paused 4ms+94ms
01-25 17:25:11.912: DEBUG/SntpClient(71): request time failed: java.net.SocketException: Address family not supported by protocol
01-25 17:25:24.961: VERBOSE/log(12612): onPageFinished: file:///android_asset/www/index.html#goToNode/2
01-25 17:25:27.276: VERBOSE/log(12612):  on ovverRide about:blank
01-25 17:25:44.464: VERBOSE/log(12612): onPageFinished: file:///android_asset/www/index.html#goToNode/328
01-25 17:26:25.692: VERBOSE/log(12612): onPageFinished: file:///android_asset/www/index.html#goToNode/10
01-25 17:26:25.901: DEBUG/dalvikvm(12612): GC_CONCURRENT freed 619K, 10% free 7242K/8007K, paused 4ms+3ms
01-25 17:26:33.711: VERBOSE/log(12612): login main url http://imprintingdesign.com/hiren_testing/TestHopeNew/testHope/pdf/TheMountain.mp4
01-25 17:26:33.781: VERBOSE/log(12612): login main url[0] http://imprintingdesign.com/hiren_testing/TestHopeNew/testHope/pdf/TheMountain.mp4
01-25 17:26:35.631: ERROR/Error:(12612): /mnt/sdcard/Downloads/TheMountain.mp4 (Permission denied)

and my downloaded class in below:

public class MainActivity extends Activity {

    WebView myWebView;
    TextView mDisplay;
    AsyncTask<Void, Void, Void> mRegisterTask;

    String Message;
    String deviceId;
    String regId;
    IntentFilter gcmFilter;
    SharedPreferences sharedPref;
    private final String PATH = "/sdcard/download/";
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myWebView = (WebView)findViewById(R.id.webView1);


        final JavaScriptInterface myJavaScriptInterface = new JavaScriptInterface(
                this);
        myWebView.addJavascriptInterface(myJavaScriptInterface,
                "AndroidFunction");

        WebSettings settings = myWebView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setDatabaseEnabled(true);
        settings.setDomStorageEnabled(true);
        settings.setAllowFileAccess(true);
        settings.setBuiltInZoomControls(true);
        settings.setUseWideViewPort(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLoadWithOverviewMode(true);
        myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);


         myWebView.setWebViewClient(new WebViewClient() {  
               public boolean shouldOverrideUrlLoading(WebView view, String url)  {                  

                            //handle stuff here 
                            //e.g. view.loadUrl(url);   
                   Log.v("log"," on ovverRide " + url);
                            return true;    
                        }

                        public void onPageFinished(WebView view, String url) {
                            //dismiss the indeterminate progress dialog
                            Log.v("log", "onPageFinished: " + url);
                            myWebView.setEnabled(false);

                        } 
                    });

        myWebView.loadUrl("file:///android_asset/www/index.html");


    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
    public class JavaScriptInterface {
        Context mContext;

        JavaScriptInterface(Context c) {
            mContext = c;
        }
        public void DownloadUrl(String url) {
            Log.v("log","login main url " + url);

            String file_url = url;
            new DownloadFileFromURL().execute(file_url);
            //new DownloadFromUrl(v,g);

            /*String url_new = "http://"+url;
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setData(Uri.parse(url_new));
            startActivity(i);*/

        }
    }


    class DownloadFileFromURL extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread
         * Show Progress Bar Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            //showDialog(progress_bar_type);
        }

        /**
         * Downloading file in background thread
         * */
        @Override
        protected String doInBackground(String... f_url) {
            int count;
             Log.v("log","login main url[0] " + f_url[0]);
            try {
                URL url = new URL(f_url[0]);
                String name = f_url[0].substring(f_url[0].lastIndexOf("/") + 1);
                URLConnection conection = url.openConnection();
                conection.connect();
                // getting file length
                int lenghtOfFile = conection.getContentLength();

                // input stream to read file - with 8k buffer
                InputStream input = new BufferedInputStream(url.openStream(), 1024 * 5);

                // Output stream to write file
                //OutputStream output = new FileOutputStream("/sdcard/downloadedfile.jpg");
                OutputStream output = new FileOutputStream(Environment.getExternalStorageDirectory() + "/Downloads/"
                + name);
                byte data[] = new byte[5 * 1024];

                long total = 0;

                while ((count = input.read(data)) != -1) {
                    total += count;
                    // publishing the progress....
                    // After this onProgressUpdate will be called
                    publishProgress(""+(int)((total*100)/lenghtOfFile));

                    // writing data to file
                    output.write(data, 0, count);
                }

                // flushing output
                output.flush();

                // closing streams
                output.close();
                input.close();

            } catch (Exception e) {
                Log.e("Error: ", e.getMessage());
            }

            return null;
        }

        /**
         * Updating progress bar
         * */
        protected void onProgressUpdate(String... progress) 
        {
            // setting progress percentage
            //pDialog.setProgress(Integer.parseInt(progress[0]));
       }

        /**
         * After completing background task
         * Dismiss the progress dialog
         * **/
        @Override
        protected void onPostExecute(String file_url) {
            // dismiss the dialog after the file was downloaded
            //dismissDialog(progress_bar_type);

            // Displaying downloaded image into image view
            // Reading image path from sdcard
            //String imagePath = Environment.getExternalStorageDirectory().toString() + "/downloadedfile.jpg";
            // setting downloaded into image view
            //my_image.setImageDrawable(Drawable.createFromPath(imagePath));
        }

    }
  • 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-18T03:36:21+00:00Added an answer on June 18, 2026 at 3:36 am

    In AndroidManifest.xml, Select the “Permissions” tab along the bottom of the editor (Manifest – Application – Permissions – Instrumentation – AndroidManifest.xml), then “Add…” a “Uses Permission” and select the desired permission from the dropdown on the right, or just copy paste in the necessary one (such as the “android.permission.INTERNET” permission you required).

    For More information, Follow this link: http://developer.android.com/reference/android/Manifest.permission.html

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

Sidebar

Related Questions

I'm trying to run this code but this error appear: Uncaught TypeError: string is
I'm trying this code to access a property but it gives me an error:
I trying to load and save setting with this code but when I closing
I'm trying to play video from youtube using this code but I get this
I am new to Django and was trying this code in a tutorial. But
I am trying to execute this code for a listbox but its not working,
I am trying to use this code in my QT app QMap<QString,QMap> but there
I am trying to save multiple image using this code. But instead its saving
Forgive me for this unbeautiful code, but I'm trying to get it to work
I'm trying to launch embedded Youtube videos from a UIWebView, but get this error

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.