Giter VIP home page Giter VIP logo

imgurapiv3exampleandroid's Introduction

Imgur API v3 Example Android

Make sure to fill in your Imgur app Client ID and Client Secret in MyAppConstants.java.

This example uses Android Studio and Gradle.

Eclipse users look here.

imgurapiv3exampleandroid's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imgurapiv3exampleandroid's Issues

Denied access in login screen crashes app

When a user presses Enter in the username or password field of the LoginActivity (possible in Swiftkey, can't speak for AOSP keyboard), he is directed to the redirect URL of his API with an access denied info in the URL params.

This triggers the parsing of the TokenURL but crashes the Matcher (because obviously, there are no tokens to be found).

Surrounding the matching parts with try/catch and setting the WebView URL to the original one in the catch part - together with a Toast for the user reminding him to click on allow - is a hacky but quick way to solve the problem.

As this part will probably the most copied one, a fix would be great. Another question: Is the API actually working as it should if it redirects the user even when access is denied?

Other than that, I really enjoy working with your API, keep the great work up!

Cheers,

Rob

Force close on login attempt

When trying to login, I get a force close no matter what I do:

  • run app, substituting real ID and Secret before compilation
  • Click on overflow icon to Login
  • select any of the four options, and click Allow -> FC
    or
  • enter a user/pass combination, and click Allow -> FC

A similar stack trace for each try:

11-19 21:33:55.756    1279-1279/com.imgur.api3example E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.IllegalStateException: No successful match so far
            at java.util.regex.Matcher.ensureMatch(Matcher.java:579)
            at java.util.regex.Matcher.group(Matcher.java:352)
            at com.imgur.api3example.login.LoginActivity$1.shouldOverrideUrlLoading(LoginActivity.java:48)
            at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:270)
            at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:372)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)

I'm trying to authenticate using Scribe in my app, but having a bit of trouble understanding the workflow (I assumed I'd get a response directly, rather than requiring a webview or something).

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.