Git Product home page Git Product logo

android-viewer-for-khan-academy's Introduction

Concentric Sky

Viewer for Khan Academy

Viewer for Khan Academy was developed by Concentric Sky in Eugene Oregon free of charge. Concentric Sky develops educational software solutions for companies and organizations like Cengage Learning, Encyclopedia Britannica, National Geographic, and Junyo. Education is in our roots, and we felt like building Viewer for Khan Academy (and open sourcing it) was an opportunity to give back to the world. Enjoy.

This repository contains the source code for the Viewer for Khan Academy Android app available from Google Play and the Amazon Appstore.

Please see the issues section to report any bugs or feature requests and to see the list of known issues.

Table of Contents

Building

The Basics

The build requires Maven v3.0.3+ and the Android SDK to be installed in your development environment. In addition you'll need to set the ANDROID_HOME environment variable to the location of your SDK:

export ANDROID_HOME=/Users/austinlally/opt/android/sdk
API Credentials

Khan Academy API credentials are stored outside the repo for security reasons, so copy over the sample file:

cp oauth_credentials.json.sample res/raw/oauth_credentials.json

Without a valid API key, most of the app will still run fine. When trying to log in, though, you'll be presented with a blank page and the text "OAuth error. Invalid consumer." To use user login features, register at https://www.khanacademy.org/api-apps/register and enter the appropriate values into oauth_credentials.json.

With Maven installed and configured and oauth_credentials.json in place, build as follows:

  • Run mvn clean install from the repository root directory to build the APK.
  • Run mvn clean install android:deploy android:run to install and run the app also.

NOTE: If you already have the app installed through the Play or Amazon store, you'll need to remove it before installing a custom built version.

Content

There is a small python script to download the Khan Academy topic tree and build a database. We ship the application with a pre-built database to avoid a long initial startup time.

You'll want pip and virtualenv.

Initial setup:

cd etc/scripts
virtualenv --distribute env
source env/bin/activate
pip install -r requirements.txt

Each time you want to build a db:

cd etc/scripts
python build_db.py

To build the new db with the app, copy the output of this script to res/raw/db.

Acknowledgements

This project relies on the following other free software:

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, are welcomed and appreciated and will be thoroughly reviewed and discussed.

License

####GPL Version 3

Viewer for Khan Academy Copyright (C) 2012 Concentric Sky, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

For the full license text, follow the link above or see the LICENSE file.

About Concentric Sky

For nearly a decade, Concentric Sky has been building technology solutions that impact people everywhere. We work in the mobile, enterprise and web application spaces. Our team, based in Eugene Oregon, loves to solve complex problems. Concentric Sky believes in contributing back to our community and one of the ways we do that is by open sourcing our code on GitHub. Contact Concentric Sky at [email protected].

android-viewer-for-khan-academy's People

Contributors

joeybruckner avatar

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

Watchers

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

android-viewer-for-khan-academy's Issues

Doesn't start

Closes every time I try to open it.
Android 5.1.1 (also didn't work with 5.1)
F-Droid build 1.2.2

Cannot build project with mvn clean install

I installed android sdk from macports and then ran mvn clean install and got the following error:

Missing:

  1. android.support:compatibility-v4:jar:r11

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=android.support -DartifactId=compatibility-v4 -Dversion=r11 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=android.support -DartifactId=compatibility-v4 -Dversion=r11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) com.concentricsky.android:khanacademy:apk:1.0.0-SNAPSHOT
2) android.support:compatibility-v4:jar:r11


1 required artifact is missing.

for artifact:
com.concentricsky.android:khanacademy:apk:1.0.0-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2),
codehaus-snapshots (http://snapshots.repository.codehaus.org),
springsource-repo (http://repo.springsource.org/release)

Crash on startup

I built this from source with the following patch to pom.xml, because I figured all the artifacts should be available on mvncentral :

diff --git a/pom.xml b/pom.xml
index b762225..873eff9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,17 +7,6 @@
     <packaging>apk</packaging>
     <name>Viewer for Khan Academy</name>

-    <repositories>
-        <repository>
-            <id>codehaus-snapshots</id>
-            <url>http://snapshots.repository.codehaus.org</url>
-        </repository>
-        <repository>
-            <id>springsource-repo</id>
-            <name>SpringSource Repository</name>
-            <url>http://repo.springsource.org/release</url>
-        </repository>
-    </repositories>

     <dependencies>
         <dependency>
@@ -27,15 +16,10 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>android.support</groupId>
-            <artifactId>compatibility-v4</artifactId>
-            <version>11</version>
-        </dependency>
-        <!-- <dependency>
             <groupId>com.google.android</groupId>
             <artifactId>support-v4</artifactId>
             <version>r11</version>
-        </dependency> -->
+        </dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-core</artifactId>
@@ -132,7 +116,7 @@
                 <plugin>
                     <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                     <artifactId>android-maven-plugin</artifactId>
-                    <version>3.3.2</version>
+                    <version>3.6.1</version>

                     <extensions>true</extensions>
                 </plugin>

It crashes with this on stock Nexus 7 running 4.3:
W/dalvikvm(21657): threadid=1: thread exiting with uncaught exception (group=0x41a2e700) E/AndroidRuntime(21657): FATAL EXCEPTION: main E/AndroidRuntime(21657): java.lang.RuntimeException: Unable to create service com.concentricsky.android.khanacademy.data.KADataService: java.lang.IllegalStateException: Could not construct instance of helper class class com.concentricsky.android.khanacademy.data.db.DatabaseHelper E/AndroidRuntime(21657): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2587) E/AndroidRuntime(21657): at android.app.ActivityThread.access$1600(ActivityThread.java:141) E/AndroidRuntime(21657): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1338) E/AndroidRuntime(21657): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(21657): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(21657): at android.app.ActivityThread.main(ActivityThread.java:5103) E/AndroidRuntime(21657): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(21657): at java.lang.reflect.Method.invoke(Method.java:525) E/AndroidRuntime(21657): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) E/AndroidRuntime(21657): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime(21657): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(21657): Caused by: java.lang.IllegalStateException: Could not construct instance of helper class class com.concentricsky.android.khanacademy.data.db.DatabaseHelper E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OpenHelperManager.constructHelper(OpenHelperManager.java:217) E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OpenHelperManager.loadHelper(OpenHelperManager.java:165) E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OpenHelperManager.getHelper(OpenHelperManager.java:75) E/AndroidRuntime(21657): at com.concentricsky.android.khanacademy.data.KADataService.onCreate(KADataService.java:146) E/AndroidRuntime(21657): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2577) E/AndroidRuntime(21657): ... 10 more E/AndroidRuntime(21657): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime(21657): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime(21657): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OpenHelperManager.constructHelper(OpenHelperManager.java:215) E/AndroidRuntime(21657): ... 14 more E/AndroidRuntime(21657): Caused by: java.lang.IllegalStateException: Could not load object config file E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.<init>(OrmLiteSqliteOpenHelper.java:87) E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.<init>(OrmLiteSqliteOpenHelper.java:54) E/AndroidRuntime(21657): at com.concentricsky.android.khanacademy.data.db.DatabaseHelper.<init>(DatabaseHelper.java:104) E/AndroidRuntime(21657): ... 17 more E/AndroidRuntime(21657): Caused by: java.sql.SQLException: DatabaseTableConfig reading from stream cannot parse line: { E/AndroidRuntime(21657): at com.j256.ormlite.table.DatabaseTableConfigLoader.fromReader(DatabaseTableConfigLoader.java:74) E/AndroidRuntime(21657): at com.j256.ormlite.table.DatabaseTableConfigLoader.loadDatabaseConfigFromReader(DatabaseTableConfigLoader.java:32) E/AndroidRuntime(21657): at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.<init>(OrmLiteSqliteOpenHelper.java:85) E/AndroidRuntime(21657): ... 19 more W/ActivityManager( 433): Force finishing activity com.concentricsky.android.khan/com.concentricsky.android.khanacademy.app.HomeActivity I/WindowManager( 433): Screenshot max retries 4 of Token{42925988 ActivityRecord{42b9c190 u0 com.concentricsky.android.khan/com.concentricsky.android.khanacademy.app.HomeActivity}} appWin=Window{427d7720 u0 Starting com.concentricsky.android.khan} drawState=4 W/WindowManager( 433): Screenshot failure taking screenshot for (1280x800) to layer 22060 W/ActivityManager( 433): Activity pause timeout for ActivityRecord{42b9c190 u0 com.concentricsky.android.khan/com.concentricsky.android.khanacademy.app.HomeActivity} W/ActivityManager( 433): Activity destroy timeout for ActivityRecord{42b9c190 u0 com.concentricsky.android.khan/com.concentricsky.android.khanacademy.app.HomeActivity}

Where are downloads stored?

Hey!

First of all, thank you for this app, works like a charm so far! The only problem I'm having is that I would like to view the lectures in split screen mode on my Galaxy Note Pro (in portrait mode), with the video in the top half of the screen and S-Note below for taking notes, which the app does not seem to support.

A simple workaround could be to not use the app to display the videos but a video player capable of split screen display. I wanted to try that out and already searched for the videos but could not find them. I also searched e.g. in Constants.java and some other files on github to try and find the location in the source code, but to no success.

Could you please tell me where the downloads are stored?

Regards,

Christian

A Display Bug

Dear developer
In the process of using, I found a bug in layout / display. As shown in the figure, the text is blocked at the top of the "for teacher" interface. Repeat steps: first click "coach resources", then select "for teacher", and then you can see that the text under "for teacher" is blocked. The cause of the problem may be an adaptation problem.
App version is 1.2.2, my mobile phone is Google nexus 6, screen resolution setting is 1440 * 2560, font size is the largest, Android system is 8.0.
The above is a description of the problem. The overall experience of the software is good. You can see that the design is very attentive. Thank you very much for the efforts of the developers all the time. I hope to receive a reply.
Thank you!
image

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.