Commit graph

58 commits

Author SHA1 Message Date
Yueyu
b52045f221 Android: fix newIntent content import 2021-04-09 21:39:38 +08:00
Yueyu
c186305777 Android: fix project name 2021-04-09 13:37:43 +08:00
Yueyu
d77fc04f2d Android: import project in native 2021-04-09 13:17:05 +08:00
Yueyu
0d6918d508 clean up zips before creating a new one 2021-03-22 13:05:58 +08:00
Yueyu
07ce9bf7c8 switch zip to native 2020-11-13 08:11:38 +08:00
Chris Garrity
647fb2cb0c Update versions to match official 2020-09-30 13:09:37 -04:00
Chris Garrity
4826fc0b1e refactor permission request 2020-09-30 09:57:26 -04:00
Ben Wheeler
685389bfbd only call setAnalyticsPref with a valid key, value pair 2020-08-14 13:50:36 -04:00
Ben Wheeler
dcd4222b4c Move json stringify and parsing into interface 2020-08-14 12:14:20 -04:00
Ben Wheeler
c301a1090e add generic setAnalyticsPref functions for iOS and Android 2020-08-13 18:24:25 -04:00
Chris Garrity
09c52f370f Android studio changes
Android Studio added some more config files.
2020-08-10 09:22:33 -04:00
Chris Garrity
1420a5947a Split iOS and Android interfaces
Refactor the native interface in preparation for switching iOS to use WKWebview.
* Finally rename the folder for device specific interfaces as `tablet` instead of `iPad`
* Update `import` statements to use the new name
* Create new `iOS.js` and `Android.js` based on previous `iPad/iOS.js` to separate the interfaces
* Add new `OS.js` class to manage the class variables, initialize the device interface delegate methods to the correct interface.
* refactor how  `utils/lib` detects the current platform based on `navigtor.userAgent` based on https://stackoverflow.com/questions/37591279/detect-if-user-is-using-webview-for-android-ios-or-a-regular-browser. previous method relied on the Android interface being loaded or not. It can be difficult to detect the difference between in a browser and in a webview, but for now ScratchJr doesn’t need to worry about running in a browser
2020-08-10 09:11:47 -04:00
Benjamin Wheeler
dc8990f9ab
Merge pull request #260 from benjiwheeler/analytics
Add more analytics events, and use action as event type
2020-06-24 14:17:45 -04:00
Chris Garrity
ec9387115f Avoid concatenation in AndroidManifest
Trying to use the extension pattern this way gets an error when uploading the APK to Google Play, so just hard code the extension patters. This won’t work for PBS kids version.
2020-04-21 09:52:42 -04:00
Ben Wheeler
9e30b90a17 ios and android log event action as event type 2020-04-13 22:11:09 -04:00
Chris Garrity
1e3d468c33 Don’t export as email message, and be less strict about import requirements
Don’t export as email message. and be less strict about import requirements.

Android intent filters are really only designed to work with standard mimetypes (like ‘image/png’). Even if you can share something with a custom mime type, it’s likely to get lost somewhere along the way, from email, or Gdrive, or Files app etc.

Path matching patterns in intent filter only apply to `file` schemes, `content` scheme is likely to be some generated id in temp storage. `content` filters maintly go by mimetype, but as noted above, a custom mimetype has often gone AWOL. Generic application files are usually downloaded as `application/octet-stream`. Basically we have to trust the user not to try to load some other random file into ScratchJr. The import function will fail and give an error message if they do.

Finally, fix the way we’re sharing ScratchJr files. While the button says ‘Share by Email’ for a long time Android has shown a selection of ways to share the file. However, we were setting the mime type as an email message so the saved file would always try to open in an email client instead of ScratchJr.
2020-04-13 17:07:38 -04:00
chrisgarrity
098b2dc68a
Merge pull request #255 from LLK/require-touchscreen
Require touchscreen in the Android manifest
2020-04-07 15:09:06 -04:00
Chris Garrity
16ee3f9213 Require touchscreen in the Android manifest
Fixes #233
2020-04-07 15:06:08 -04:00
chrisgarrity
bca5f433ae
Merge pull request #206 from beskrovnykh/develop
Fix can't import .sjr
2020-04-07 15:00:10 -04:00
Chris Garrity
9a12f98cf9 Add checks for filetype, skip unnecessary FileIO
This PR was 95% of the way there, and I didn’t want to ask for changes after not getting to review it for so long, so I just made the changes.

Thanks for submitting!
2020-04-07 14:56:26 -04:00
Chris Garrity
0a580324bf FIx. debugging 2020-01-16 08:49:59 -05:00
Chris Garrity
f6dbdd4fe7 Fix Android scaling
On some newer android devices the screen tranform matrix already includes the current scale. i.e. the matrix looks like:
```
{
    a: scaleX,
    b: 0,
    c: 0,
    d: scaleY,
    e: offsetX,
    f: offsetY
}
```
where both `scaleX`, and `scaleY` are the current zoom. On other devices the scale is always `1`, and we need to apply our own scaling.

I also added the code to automatically allow webview debgging if the buildType is debuggable.  Also, note that you can switch which line is commented out in bundle-compile.sh to get unobfuscated javascript.
2020-01-15 08:42:11 -05:00
Chris Garrity
d71df52d6b Don’t allow overscroll
The iOS change seems to have a side effect on Android of adding  an“Edge Effect” to the web view whenever dragging a block. (Edge effects are the grey curved shadow that appears at the top or bottom of a container when you overscroll. When you drag a block they appear at the top or bottom of the screen)

Adding the `android:overScrollMode=“never”` attribute to the webview means the edge effect doesn’t appear.
2019-10-25 16:19:41 -04:00
Chris Garrity
c8f655447a Address comments 2019-10-25 12:27:32 -04:00
Chris Garrity
b965440709 Switch to firebase analytics
* Remove ScratchJrApplication class - it was only being used to initialize the old Google Analytics.
* Change AppUsage (home, school, other, noanswer) from being a prefix on `label` to being a Firebase user property.
* Set the user property when loading the index page - it shouldn’t change for the rest of the session.
2019-10-21 10:48:03 -04:00
Chris Garrity
1be3feb791 ensure ‘switchToFree’ gets run before generating PNGs
The assemble.depends on doens’t seem to ensure that the correct sources are copied to the HTML5 directory
2019-10-18 10:55:27 -04:00
Chris Garrity
63112f4ca8 Add files to gitignore 2019-09-25 13:36:21 +01:00
DD Liu
57bcffea6c Update to gradle 5 and update support dependencies 2019-09-09 16:15:24 -04:00
chrisgarrity
49d8b5a3df Move the parental gate before the share buttons
Change the share flow to have a ‘For Parents’ button that brings up the Parental Gate. Share buttons only become visible after a successful challenge.
2019-04-06 16:44:37 -04:00
Andrey Beskrovnykh
bbba46c143 Add forgotten input stream initialization 2018-11-23 19:21:01 +07:00
Andrey Beskrovnykh
1a2433885d Fix possible backward compatibility issue 2018-11-23 10:50:56 +07:00
Andrey Beskrovnykh
d7bd9789dd Fix can't import sjr 2018-11-22 21:23:36 +07:00
chrisgarrity
184b5ba6f9 revise minimum screen width
The previous change removed the legacy screen sizes, but left the `requiresSmallestWidthDp` at 500. According to https://developer.android.com/guide/topics/manifest/supports-screens-element#requiresSmallest, a 7-inch tablet corresponds to 600dp.
2018-10-29 15:21:58 -04:00
chrisgarrity
19699e18b4 Fix Android (gradle) build error
Builds that worked one day, suddenly fail the next. The error is:
`Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).`

Re-ordering the repositories fixes the issue (from Stack Overflow):
https://stackoverflow.com/questions/50563407/could-not-find-play-services-basement-aar
2018-10-29 09:35:57 -04:00
chrisgarrity
1fcdff79f2 Remove unnecessary screen settings from manifest 2018-10-01 17:12:03 -04:00
chrisgarrity
21bb1a1eb6 Updated versions to allow building 2018-10-01 16:32:29 -04:00
Practical Education Network
8908e40915 updated android SDK versions 2018-04-04 12:47:32 -04:00
chrisgarrity
46f77164d8 Reduced sound effects to 16-bit for Android compatibility
- down sampled all the .wav files
- updated plist for free edition to include new required keys for iOS10
2017-03-13 13:56:02 -04:00
chrisgarrity
ef04f2e1e2 add default uses-sdk
PBS Kids has automated testing that looks for uses-sdk with a minimum targetSDK of 23. Even though this gets overridden in the build.gradle settings, adding a line with default values to get through their testing.
2016-08-12 10:48:49 -04:00
chrisgarrity
2245410d99 Update SmallestWidthDp in manifest
Changed android:requiresSmallestWidthDp from 600 to 500.
Android suggests that 600 is a normal value for 7 inch tablets and up. It turns out that many 7-inch tablets are in the 500-600 range (half of the Amazon ones for example).

Fixes #85
2016-05-16 10:29:49 -04:00
chrisgarrity
fca4cd04cf Make microphone optional in manifest 2016-05-09 10:59:44 -04:00
chrisgarrity
0ba59b499d More clean up of Android studio files
untrack workspace.xml and remove obsolete files
2016-05-02 13:02:36 -04:00
chrisgarrity
4734b53f49 Updating .gitignore
Untracking gradle.xml, updating .gitgnore.
2016-05-02 11:05:08 -04:00
chrisgarrity
a93d91808d Untrack app.iml 2016-05-02 09:30:43 -04:00
Andrew Sliwinski
289343373a Remove redundant 'setAcceptCookie' call 2016-04-06 19:39:16 -04:00
Andrew Sliwinski
a7ae9b586d Explicitly persist and accept cookies. Resolves GH-36 2016-04-06 19:35:20 -04:00
chrisgarrity
f778a02333 Increment Android version code 2016-03-01 15:00:10 -05:00
Tim Mickel
b7c5a92f51 Merge pull request #5 from tmickel/modules
Modules
2016-02-03 15:26:32 -05:00
Tim Mickel
91848c6ea1 Merge pull request #1 from tmickel/exif-camera-rotation
Rotate Android photos to account for JPEG/EXIF rotation
2016-02-03 15:26:17 -05:00
Tim Mickel
9360e6d9d2 Bumping version codes to 1.2.0 2016-02-03 15:00:55 -05:00