With ScratchJr, young children (ages 5-7) can program their own interactive stories and games.
Find a file
Deep Malhan ff15b0f5f0
Merge pull request #522 from yueyuzhao/issue/504-dots-to-sharp-corner
add precise guess first when adding points to paths
2022-04-08 08:50:11 -04:00
.github Add default templates to repo 2020-06-17 16:30:24 -04:00
.idea Update to gradle 5 and update support dependencies 2019-09-09 16:15:24 -04:00
android android: continue to SecurityException 2022-04-05 22:56:58 +09:00
bin Fix Android scaling 2020-01-15 08:42:11 -05:00
doc Initial commit 2016-01-08 14:31:04 -05:00
editions/free Merge pull request #537 from LLK/translations_editions-free-src-localizations-en-json--develop_pl 2022-04-04 14:38:04 -04:00
ios Merge pull request #528 from yueyuzhao/issue/430-share-project-with-single-quote 2022-04-05 09:14:47 -04:00
src Merge pull request #522 from yueyuzhao/issue/504-dots-to-sharp-corner 2022-04-08 08:50:11 -04:00
.editorconfig Add .editorconfig file 2018-09-11 12:59:48 +08:00
.eslintignore Ignore linting for bundles 2016-01-21 15:37:55 -05:00
.eslintrc Asynchronous loading of MediaLib 2016-01-22 16:19:51 -05:00
.gitignore Improve Analytics setup documentation 2020-03-24 17:39:06 -04:00
LICENSE Add license and trademark. Update package.json author information. Resolves GH-473 2016-05-18 04:58:44 -07:00
package-lock.json [WIP] Initial version with WKWebView 2020-08-17 10:37:14 -04:00
package.json Javascript: remove jszip 2021-04-09 21:56:08 +08:00
README.md Corrected the link for CONTRIBUTING.md 2021-08-23 10:15:31 +05:30
TRADEMARK Update TRADEMARK 2018-06-18 13:19:00 -04:00
webpack.config.js [WIP] Initial version with WKWebView 2020-08-17 10:37:14 -04:00

Overview

This is the official git repository hosting the source code for the ScratchJr project.

ScratchJr can be built both for iOS and Android. A pure-web version is planned to follow at some point in the future.

Platform Status
iOS Released in App Store
Android Released in Google Play

Architecture Overview

The diagram below illustrates the architecture of ScratchJr and how the iOS (functional), Android (functional) and pure HTML5 (future) versions share a common client.

Scratch Jr. Architecture Diagram

Directory Structure and Projects

This repository has the following directory structure:

  • src/ - Shared JavaScript code for iOS and Android common client. This is where most changes should be made for features, bug fixes, UI, etc.
  • editions/ - Assembly directories for each "flavor" of ScratchJr. These symlink to src for common code, and could diverge in settings and assets.
    • free/ - Free edition JavaScript, including all shared code for all releases
  • android/ - Android port of Scratch Jr. (Java, Android Studio Projects)
    • ScratchJr/ - Android Studio Project for ScratchJr Android Application
  • bin/ - Build scripts and other executables
  • doc/ - Developer Documentation
  • ios/ - Xcode project for iOS build. (Make sure to open ScratchJr.xcworkspace not ScratchJr.xcodeproj)

Building ScratchJr

Initial setup

Regardless of whether you are doing iOS development or Android development, you should do these steps.

These instructions assume you are building both versions on Mac OSX, with Homebrew installed.

  1. Clone or update the code for this repo
  2. Ensure you have node and npm installed.
  3. Run sudo easy_install pysvg to install python svg libraries
  4. Run brew install librsvg to install commandline rsvg-convert
  5. Run brew install imagemagick to install commandline magick
  6. In the top level of the scratchjr repo directory, install npm dependencies for bundling the JavaScript: npm install

Analytics

ScratchJr uses the Firebase SDK to record analytics for the app. Scratch Team developers should look for the configuration files in the Scratch Devs Vault. If you're not on the Scratch Team, then you'll need to set up your own app analytics with Google Firebase. It's free. Firebase will generate the configuration files for you to download.

  1. Place the google-services.json file in editions/free/android-resources
  2. Place the GoogleService-Info.plist file in editions/free/ios-resources

iOS

  1. To build the iOS version, you need to have a Mac with Xcode
  2. Run brew install cocoapods to install CocoaPods
  3. Run pod install to install the Firebase Analytics dependencies
  4. Open Xcode
  5. In Xcode, open ios/ScratchJr.xcworkspace

Android

  1. Install or update Android Studio
  2. In Android Studio, open the project android/ScratchJr
  3. Choose the appropriate flavor/build variant in Android Studio

Note: you can still do Android development on Ubuntu. Instead of the install commands above, run:

  1. sudo easy_install pysvg to install python svg libraries
  2. sudo apt-get install librsvg2-bin to install rsvg-convert
  3. sudo apt-get install imagemagick to install ImageMagick

Where and how to make changes

All changes should be made in a fork. Before making a pull request, ensure all changes pass our linter:

  • npm run lint

For more information, see CONTRIBUTING.md.

Code credits

ScratchJr would not be possible without free and open source libraries, including:

Acknowledgments

ScratchJr is a collaborative effort between: