How to download file in url Android 8 Oreo

How to download file in URL Android 8 Oreo.




new DownloadFileFromURL(position).execute(data.get(url));

private class DownloadFileFromURL extends AsyncTask<String, String, String> {
    private ProgressDialog p;
    private int pos = 0;

    public DownloadFileFromURL(int p) {
        pos = p;
    }

    @Override    protected void onPreExecute() {
        super.onPreExecute();
        p = new ProgressDialog(context);
        p.setMessage("Downloading 0%");
        p.setIndeterminate(false);
        p.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        p.setCancelable(false);
        p.show();
    }

    @Override    protected void onProgressUpdate(String... values) {
        super.onProgressUpdate(values);
        p.setMessage("Downloading " + values[0] + "%");
    }

    @Override    protected String doInBackground(String... f_url) {
        int count;
        String filename = f_url[0];
        String[] parts = filename.split("/");
        String part2 = parts[parts.length - 1];
        Boolean isSDPresent = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
        File myNewFolder = null;
        if (isSDPresent) {
            String newFolder = "/patelwala";
            String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
            myNewFolder = new File(extStorageDirectory + newFolder);
            if (myNewFolder.exists()) {
            } else {
                myNewFolder.mkdirs();
            }
        } else {
            String newFolder = "patelwala";
            myNewFolder = context.getDir(newFolder, Context.MODE_PRIVATE);
            if (!myNewFolder.exists()) {
                myNewFolder.mkdirs();
            }
        }
        try {
            System.out.println("Downloading");
            URL url = new URL(f_url[0]);

            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(), 8192);
            // Output stream to write file            OutputStream output = new FileOutputStream(myNewFolder + "/" + part2);
            byte data[] = new byte[1024];

            long total = 0;
            while ((count = input.read(data)) != -1) {
                //if (!Webservice.isCancelled) {                total += count;

                // writing data to file                publishProgress("" + (int) ((total * 100) / lenghtOfFile));
                output.write(data, 0, count);
              /*  } else {                    break;                }*/
            }
            // flushing output            output.flush();
            // closing streams            output.close();
            input.close();

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

        return myNewFolder + "/" + part2;
    }


    /**     * After completing background task     **/    @Override    protected void onPostExecute(String s) {
        p.dismiss();
        openDocument(s);
    }

}



public void openDocument(String name) {
    if (co == 0) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        File file = new File(name);
        String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString());
        String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
        if (extension.equalsIgnoreCase("") || mimetype == null) {
            // if there is no extension or there is no definite mimetype, still try to open the file            intent.setDataAndType(Uri.fromFile(file), "text*//*");
        } else {
            intent.setDataAndType(Uri.fromFile(file), mimetype);
        }
        // custom_alert_dialog message for the intent        context.startActivity(Intent.createChooser(intent, "Choose an Application:"));
    } else {
        co = 0;

        File f = new File(name);
        Uri uri = Uri.parse("file://" + f.getAbsolutePath());
        Intent share = new Intent(Intent.ACTION_SEND);
        //  share.putExtra(Intent.EXTRA_STREAM, uri);        String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(f).toString());
        String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
        if (extension.equalsIgnoreCase("") || mimetype == null) {
            // if there is no extension or there is no definite mimetype, still try to open the file            share.setType("text*//*");
        } else {
            share.setType(mimetype);
        }
        share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
        share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        context.startActivity(Intent.createChooser(share, "Share File"));

    }


}

How to use custom font in Android Studio

How to use custom font in Android Studio


  1. Go to the (project folder)
  2. Then app>src>main
  3. Create folder 'assets>fonts' into the main folder.
  4. Put your .ttf file into the fonts folder.
        AssetManager am = context.getApplicationContext().getAssets();
    
        typeface = Typeface.createFromAsset(am,
                String.format(Locale.US, "fonts/%s", "abc.ttf"));
    
        setTypeface(typeface);
    or try this way:
       TextView tx = (TextView)findViewById(R.id.textview1);
    
       Typeface custom_font = Typeface.createFromAsset(getAssets(),  "fonts/abc.ttf");
    
       tx.setTypeface(custom_font);

Prestige DRIP PCMD 3.0 6 Cups Coffee Maker  (Black)

Prestige DRIP PCMD 3.0 6 Cups Coffee Maker (Black)

Prestige DRIP PCMD 3.0 6 Cups Coffee Maker  (Black)



Rs. ₹1,140
Price ₹1,295 11% off


Shopping Now:- http://fkrt.it/H0I2SnuuuN

Highlights
  • Type: Filter Coffee Maker
  • Capacity: 6 Cups
  • Water Level Indicator
  • Power Consumption: 650 W
Services
  • 1 YEAR
  • 10 Days Replacement Policy
    ?
  • Cash on Delivery available
    ?
Description
Let your coffee come alive with great aroma and rich taste. Mesmerize yourself and your guests with that great cup of coffee. Prestige Drip Coffee maker - for those who love authentic South Indian filter coffee. Making great tasting filter coffee is now easy with Prestige Drip Coffee Maker. Advance Design Filter- The advance design mesh filter faciliates thick decoration for the authentic taste of South Indian filter coffee. Translucent Water Gauge - To check Water level with opening the coffee maker. Brew Basket with Lifter Handle - The brew basket with lifter handle facilitates easy removal of filter. Glass carafe - Elegant glass carafe collects filtered coffee decoction. Anti Drip valve- The filter's anti-drip valve prevents dripping when the carafe is removed. Steam vent - Releasing excess steam so that there is no pressure inside the appliance thereby ensuring safety
Read More

5 Popular Mobile Ad Networks For App Monetization



5 Popular Mobile Ad Networks For App Monetization




Many ad networks in the markets are available today. What Does Mobile Advertising Networks Do? They collect advertisements by advertisers and sell it to app publishers and developers. Advertising networks come together with advertising publishers and advertisers. They help advertisers find advertising space and app publishers, and developers can monetize their applications by selling space in their applications. Mobile ad networks collect advertising inventory from various publisher sites. The choice of ad inventory may be based on various parameters determined by the advertising network. The mobile advertising network works as web / ad servers. They take advertising requests that originate from mobile devices and offer advertising responses consistent with those requests.

Let's now look at some advertising networks. You can choose the one that best suits your interests.

# 1 Chartboost




If you are a game application editor, you should definitely try Chartboost to better monetize your application. It is an ad platform only for mobile devices that focuses primarily on players. It stands out in the cross-promotion of applications and its ads focus on fostering the installation of new gaming applications. Game application publishers opt for Chartboost to keep their user base together. Publishers choose to promote their new gaming applications in existing gaming applications. Users look for new and fun alternatives and application publishers need to promote their new games and boost their facilities; Chartboost receives a cut: everyone wins. The platform provides you with analysis and you can get a lot of knowledge on how to improve your campaigns by analyzing the data. The developers get direct access to the data generated by Chartboost. The integration with Chartboost SDK is very easy. Chartboost allows you to see who advertises in your application and where: the place. You control the ads that users of your application can see.

Campaign Type: CPC, CPI, CPCV, CPM

Supported Ad formats: Interstitial, Video and Native Ad.

Supported Platforms: iOS, Android, Unity, Cocos2dx, Wp8, Amazon, Air

Minimum Payout: $75

Payment Terms: NET 45

#2  Admob



Google's AdMob is one of the most popular mobile ad networks with cross platform capability. Over 1 million apps use AdMob and it is popular because of its high CPM and best fill rates. It is industry leading mediation platform. When you mediate from AdMob you get added advantage of over 40 third party ad networks that will help you maximize your fill rates and then increase your earnings. You can optimize the AdMob network and generate the highest CPM from your mediation stack in real time. It is very easy to use. Even if you are starting with app monetization, it is advisable to use its different tools and solutions. You can cross sell your other apps or those of your friends to your existing users.

Campaign Type: CPC, CPM, CPI

Supported Ad formats: Interstitial, Native, Trueview, Banner, Lightbox, Video

Supported Platforms: iOS, Android, Unity, Cocos2dx, Wp8

Minimum Payout: $100

Payout Terms: NET 21


#3 Unity Ads



Unity Ads is a pioneer. It made video ads to natural part of the game. Its rewarded video strategy is changing the dynamics in the industry. No one thought of engaging the whole player base of an app before Unity. Unity makes ads to natural part of the games. Developers monetize entire player base with rewarded videos. Today Unity is one of the most trusted companies in gaming which is supported by a network of more than 1B gamers. If Unity engine is already used in apps there is no need for adding the SDK. As a natural part of the gameplay, ads drive ARPU and contribute to the bigger goal - greater lifetime value (LTV) of the player.

Campaign Type: CPC, CPI, CPCV

Supported Ad format: Videos – Rewarded and Non-Rewarded

Supported Platforms: iOS, Android

Minimum Payout: $100

Payment Terms: NET 30


#4 Facebook Audience Network


With the help of Facebook Audience Network the advertisers can extend their campaigns beyond Facebook into other mobile apps. The Audience Network is a collection of mobile apps where Facebook advertisers serve ads in the mobile that have Facebook app using the same analytical and targeting tools of Facebook. Facebook uses the same native ad products in Facebook Audience Network to deliver superior results. You as an advertiser can run your Facebook ads on the Audience Network by enabling "Audience Network" in the placement section while creating or editing an ad. It pays both on clicks and impressions. Facebook Audience Network however does not provide a list of advertisers. It now boasts of more than 3 million global advertisers.

Campaign Type: CPC, CPI, CPM

Supported Ad format: Banners, Interstitial and Native Ads

Supported Platforms: iOS, Android

Minimum Payout: $100

Payment Terms: NET 21


Leadbolt is a leading mobile ad network that provides advanced partner technology match along dynamic ad delivery. It allows mobile advertisers to reach and acquire quality users at scale. Leadbolt has analytics based algorithms that can assist advertisers with advanced targeting to help the best fit audience engage optimally with Leadbolt. It is known for dealing with premium ads. Its analytical capabilities are real time and help the advertisers with optimization on different platforms. It provides app engagement data which helps the developers ensure that the advertisements shown are not sea the user engagement experience. Publishers connect directly to premium advertising partners through Direct Deals Marketplace. It helps with app downloads. It has high fill rates.

Campaign Type: CPC, CPI, CPM

Supported Ad Format: Banners, Interstitial, Native Ads, Offerwall, Rewarded Video

Supported Platform: Android, iOS

Minimum Payout: $100

Payment Terms: NET 15

WebLink: https://www.leadbolt.com/


OMG! Shocking truth of fogg perfume | Watch this video who use fogg perfume



OMG! You will Never Use Fogg Scent after watching This video - Patelwala Video Watch This video. After Watching this video you will never gonna use FOGG SCENT Subscribe to the channel for more videos. Any Question Ask me on Whatsapp +91-9601605922 This video will be live at: https://youtu.be/FvIc-aqx5J8 =========================================== ➜ LIKE ➜ SUBSCRIBE ➜ SHARE =========================================== Link Us... Why Positive YouTube Channel : https://www.youtube.com/channel/UCra4... Education YouTube Channel : https://www.youtube.com/channel/UCmOc... Tutorial Web : http://www.readranks.com/ Patelwala Web : http://www.patelwala.com/ Project Document Solution Web : http://www.Prodocx.com/

Samsung Galaxy J7 Max Unboxing & Hands on Overview

Samsung Galaxy J7 Max Unboxing &

 Hands on Overview





You can generate even $1000 a day or $0 per day with this. .... Tell me what do you think about make money with affiliate marketing system


Earn money online,earn money online in india,Online earning,YouTube earning,Adsense earning,Earning,Digital india,Best way to earn,earning app,Online earning in india,earn money app,earn money,How to online earning,How to get money online,India,Technical Guruji,How to earn money in india,online money,make money online,earn from facebook,affiliate marketing,earn money flipkart,amazon affiliate,ebay affiliate,snapdeap affiliate,make money from flipkart,flipkart earning



Make Money by becoming a Flipkart Affiliate!: https://affiliate.flipkart.com/

Flipkart App Install campaign: http://affiliate.flipkart.com/install-app?affid=saprahits

===========================================
➜ LIKE
➜ SUBSCRIBE
➜ SHARE
===========================================
Link Us...

YouTube Channel : https://www.youtube.com/channel/UCmOcd8OCD_w1TPSheXf1lHQ

Tutorial Web : http://www.readranks.com/

Patelwala Web : http://www.patelwala.com/

Project Document Solution Web : http://www.Prodocx.com/

It Debugger Web : http://www.itdebugger.com/

Facebook Page : https://www.facebook.com/patelwalatips/

Twitter : https://twitter.com/saprahits/

Linkedin : https://www.linkedin.com/in/saprahits/

Dribbble: https://dribbble.com/saprahits/

Deviantart : http://saprahits.deviantart.com/

Pinterest : https://www.pinterest.com/hitssapra/

Instagram : https://www.instagram.com/smarty_hits/

Tumblr : https://www.tumblr.com/saprahits/

Soundcloud : https://soundcloud.com/hits-sapra


So Thanks You For Watching My Viodes Places Subscribers My YouTube Channel Patelwala Tips

इन्टरनेट की 6 सबसे अनोखी वेबसाइट | 6 Most Amazing Websites on the Internet

इन्टरनेट की 6 सबसे अनोखी वेबसाइट | 6 Most Amazing Websites on the Internet




You can generate even $1000 a day or $0 per day with this. .... Tell me what do you think about make money with affiliate marketing system


Earn money online,earn money online in india,Online earning,YouTube earning,Adsense earning,Earning,Digital india,Best way to earn,earning app,Online earning in india,earn money app,earn money,How to online earning,How to get money online,India,Technical Guruji,How to earn money in india,online money,make money online,earn from facebook,affiliate marketing,earn money flipkart,amazon affiliate,ebay affiliate,snapdeap affiliate,make money from flipkart,flipkart earning



Make Money by becoming a Flipkart Affiliate!: https://affiliate.flipkart.com/

Flipkart App Install campaign: http://affiliate.flipkart.com/install-app?affid=saprahits

===========================================
➜ LIKE
➜ SUBSCRIBE
➜ SHARE
===========================================
Link Us...

YouTube Channel : https://www.youtube.com/channel/UCmOcd8OCD_w1TPSheXf1lHQ

Tutorial Web : http://www.readranks.com/

Patelwala Web : http://www.patelwala.com/

Project Document Solution Web : http://www.Prodocx.com/

It Debugger Web : http://www.itdebugger.com/

Facebook Page : https://www.facebook.com/patelwalatips/

Twitter : https://twitter.com/saprahits/

Linkedin : https://www.linkedin.com/in/saprahits/

Dribbble: https://dribbble.com/saprahits/

Deviantart : http://saprahits.deviantart.com/

Pinterest : https://www.pinterest.com/hitssapra/

Instagram : https://www.instagram.com/smarty_hits/

Tumblr : https://www.tumblr.com/saprahits/

Soundcloud : https://soundcloud.com/hits-sapra


So Thanks You For Watching My Viodes Places Subscribers My YouTube Channel Patelwala Tips

live hosting purchase only Rs 1500 in microhost

live hosting purchase only Rs 1500 in microhost


Thank You For Watching My Video Places Subscribers My YouTube Channel Patelwala Tips.




You can generate even $1000 a day or $0 per day with this. .... Tell me what do you think about make money with affiliate marketing system


Earn money online,earn money online in india,Online earning,YouTube earning,Adsense earning,Earning,Digital india,Best way to earn,earning app,Online earning in india,earn money app,earn money,How to online earning,How to get money online,India,Technical Guruji,How to earn money in india,online money,make money online,earn from facebook,affiliate marketing,earn money flipkart,amazon affiliate,ebay affiliate,snapdeap affiliate,make money from flipkart,flipkart earning



Make Money by becoming a Flipkart Affiliate!: https://affiliate.flipkart.com/

Flipkart App Install campaign: http://affiliate.flipkart.com/install-app?affid=saprahits

===========================================
➜ LIKE
➜ SUBSCRIBE
➜ SHARE
===========================================
Link Us...

YouTube Channel : https://www.youtube.com/channel/UCmOcd8OCD_w1TPSheXf1lHQ

Tutorial Web : http://www.readranks.com/

Patelwala Web : http://www.patelwala.com/

Project Document Solution Web : http://www.Prodocx.com/

It Debugger Web : http://www.itdebugger.com/

Facebook Page : https://www.facebook.com/patelwalatips/

Twitter : https://twitter.com/saprahits/

Linkedin : https://www.linkedin.com/in/saprahits/

Dribbble: https://dribbble.com/saprahits/

Deviantart : http://saprahits.deviantart.com/

Pinterest : https://www.pinterest.com/hitssapra/

Instagram : https://www.instagram.com/smarty_hits/

Tumblr : https://www.tumblr.com/saprahits/

Soundcloud : https://soundcloud.com/hits-sapra


So Thanks You For Watching My Viodes Places Subscribers My YouTube Channel Patelwala Tips

Top 5 web hosting companies in world

Top 5 web hosting companies in world


No 1 : https://www.godaddy.com/offers/web-ho... No 2 : https://www.hostingraja.in/ No 3 : https://www.bigrock.in/web-hosting/ No 4 : https://www.bluehost.in/web-hosting/ No 5 : https://www.microhost.com/linux-web-h... Thank You For Watching My Video Places Subscribers My YouTube Channel Patelwala Tips


You can generate even $1000 a day or $0 per day with this. .... Tell me what do you think about make money with affiliate marketing system


Earn money online,earn money online in india,Online earning,YouTube earning,Adsense earning,Earning,Digital india,Best way to earn,earning app,Online earning in india,earn money app,earn money,How to online earning,How to get money online,India,Technical Guruji,How to earn money in india,online money,make money online,earn from facebook,affiliate marketing,earn money flipkart,amazon affiliate,ebay affiliate,snapdeap affiliate,make money from flipkart,flipkart earning



Make Money by becoming a Flipkart Affiliate!: https://affiliate.flipkart.com/

Flipkart App Install campaign: http://affiliate.flipkart.com/install-app?affid=saprahits

===========================================
➜ LIKE
➜ SUBSCRIBE
➜ SHARE
===========================================
Link Us...

YouTube Channel : https://www.youtube.com/channel/UCmOcd8OCD_w1TPSheXf1lHQ

Tutorial Web : http://www.readranks.com/

Patelwala Web : http://www.patelwala.com/

Project Document Solution Web : http://www.Prodocx.com/

It Debugger Web : http://www.itdebugger.com/

RStudio Videos Website : https://goo.gl/A6srA8

Facebook Page : https://www.facebook.com/patelwalatips/

Google Plus Page : https://plus.google.com/1138487520438...

Twitter : https://twitter.com/saprahits/

Linkedin : https://www.linkedin.com/in/saprahits/

Dribbble: https://dribbble.com/saprahits/

Deviantart : http://saprahits.deviantart.com/

Pinterest : https://www.pinterest.com/hitssapra/

Instagram : https://www.instagram.com/smarty_hits/

Tumblr : https://www.tumblr.com/saprahits/

Soundcloud : https://soundcloud.com/hits-sapra


So Thanks You For Watching My Viodes Places Subscribers My YouTube Channel Patelwala Tips