Giter Club home page Giter Club logo

libgeticon's Introduction

#libGetIcon This library enables to download apps icons from the playstore thanks to its package name.

How to use it ?

The jar file of the library can be found in the libs folder. Add it to your project as a library. Add the internet permission to your app. If you don't, a message will ask you do to so

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

Define the default icon you want. This icon will be displayed while the icon is grabbed from the playstore or if an issue occurs (wrong package name, connection issue,..)

Drawable defaultIcon = this.getResources().getDrawable(R.drawable.ic_launcher);
// OR
Drawable defaultIcon = this.getResources().getDrawable(R.mipmap.ic_launcher);

Then create the download parameters:

  • Cache: If true, the icons will be saved in the cache folder. If the icon has to be loaded several times, the icon will be loaded from the cache instead of being downloaded again. Default value = false.
  • Size: You can choose the size in px of the icon you want to download. Default value = 300
  • Default icon.

Here is an example of the parameters.

Parameter param = new Parameter()
                    .setCache(true)
                    .setSize(100)
                    .setDefaultIcon(defaultIcon);

Initialize the manager with a context and the parameters:

Manager m = new Manager(this, param);

Then select download an icon in an imageView

m.download(image1, "com.facebo  &=1ok.%20");    // Nothing will be downloaded
m.download(image2,"com.netmarble.mherosg");	// False package name
m.download(image3,"com.netmarble.mherosgb");
m.download(image4,"com.facebook.katana");
m.download(image5,"com.ustwo.monumentvalley");
m.download(image6,"com.facebook.katana");

The result of the following code is this one:

You can also empty the cach with the following code

m.deleteCache(this);

How to compile the jar ?

On Android Studio, open the terminal and run the following command in the root folder of the project:

gradlew makeJar

The created jar file will be saved in the libs folder

libgeticon's People

Watchers

Jérôme Duban avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.