GithubHelp home page GithubHelp logo

liweiyap / xkcdbrowser-android Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.33 MB

Simple browser app on Android for the XKCD comic. Comic-strip metadata is retrieved from the XKCD website in JSON format.

Home Page: https://xkcd.com/

License: MIT License

Java 100.00%
xkcd xkcd-scraper android comic comic-reader comic-downloader

xkcdbrowser-android's Introduction

Hi, I'm Li-Wei! I'm a software engineer with a keen interest in Android development. I strive to become a more creative problem solver, be it in UI design or in the development of the business logic of an application.

I especially love to work with:

I also have professional experience with:

I am also comfortable in:

I have basic knowledge of:

Let's connect! 😄

xkcdbrowser-android's People

Contributors

liweiyap avatar

Watchers

 avatar  avatar

xkcdbrowser-android's Issues

`MediaStore.Images.Media.insertImage()` is deprecated from API 28, but in my alternative code, the saved image is deleted as soon as the OutputStream is closed.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
    ContentResolver contentResolver = getContentResolver();
    ContentValues contentValues = new ContentValues();
    contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, Environment.DIRECTORY_PICTURES);
    contentValues.put(MediaStore.Images.Media.IS_PENDING, true);
    contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, mComicTitleTextView.getText().toString());
    contentValues.put(MediaStore.Images.Media.MIME_TYPE, "image/jpg");

    Uri imageUri = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
    Bitmap bitmap = ((BitmapDrawable) mComicPhotoView.getDrawable()).getBitmap();
    try {
        OutputStream fos = contentResolver.openOutputStream(imageUri);
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
        fos.flush();

        contentValues.put(MediaStore.MediaColumns.IS_PENDING, false);
        contentValues.clear();
        contentResolver.update(imageUri, contentValues, null, null);

        fos.close();
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
}

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.