1. 14 Feb, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Make the backpack persistent · 3548e1dc
      Jeffrey I. Schiller authored
      We store the backpack in a new “user file” named backpack.xml (the other
      user file supported is “android.keystore” for the user’s signing
      key). As an optimization we remove the backpack.xml file if we store
      “[]” in it (the empty backpack represented as an empty JSON string).
      
      Change-Id: I16fb747f31e59d30535f690c1b35c80bde53629f
      3548e1dc
  2. 10 Feb, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Throttle Calls to MockForm.refresh() · e5b0d1eb
      Jeffrey I. Schiller authored
      Limit the number of calls to MockForm.refresh(). This lets a project
      with a lot of designer objects load when otherwise the exponential time
      and space consumption of repeated and nested calls to refresh() would
      cause it to fail to load.
      
      This implementation throttles the calls “locally.” The idea is to limit
      the number of calls to 1 every 2 seconds. An alternative implementation
      would be to set a flag while a project is loading (which is when this is
      a problem) and inhibit all calls to refresh while this flag is set. Then
      when the project is no longer loading, clear the flag and do one final
      call to refresh. However this would be tricky because loading is
      asynchronous and knowing when it is completely finished is
      complicated. Such an implementation would be spread over several
      modules, and add complexity to the codebase. This change is simpler
      because it is limited to one module.
      
      We also add a logging call Ode.CLog to Ode that logs to the developer
      console instead of the OdeLog module which logs to the special debug
      tab. There are situations where logging to the console is desirable,
      like when the problem you are attempting to debug leaves App Inventor
      locked up so you cannot see the debug tab!
      
      Change-Id: I5fb9c832704e87c6e73903dc3a75ceb79df5f7f3
      e5b0d1eb
  3. 05 Feb, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Use a transaction in createProject in production · 08ad4ee1
      Jeffrey I. Schiller authored
      Do not use a transaction when running in the dev server as this causes a
      multi-entity group error. This happens because the dev server simulates
      the Google Cloud Store using the datastore. If we use a transaction in
      create project it winds up covering multiple entity groups. One for our
      modifications to the “FileData” kind and a second for the simulated GCS
      bucket kind.
      
      Change-Id: I4a31eb16c7866e4ed721c02dbc77addea8df3dbf
      08ad4ee1
  4. 30 Jan, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Permit newer version projects to run · 11bdf459
      Jeffrey I. Schiller authored
      Remove the check in versioning.js that throws an exception if a
      component version is newer then the system version. This exception
      guaranteed that a project touched by a newer version of App Inventor
      would not work in the current version.
      
      With this change the project may work if the newer version made not
      incompatible changes. The user is shown a warning dialog stating that
      the project might not work.
      
      Change-Id: I72c15383b20d918ffd0077d6f7a10f8d1dd4b345
      11bdf459
  5. 27 Jan, 2017 2 commits
  6. 23 Jan, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Add a Generic MessageDialog system. · 486ac4ba
      Jeffrey I. Schiller authored
      Refactoring to reduce the number of unique dialog boxes instantiated by
      Ode. We add this generic MessageDialog method and use it for the
      Firebase experimental warning, eliminating the ode.warningDialog
      method. Future refactoring can remove more unique dialogs.
      
      Change-Id: I77e1df2a359424aac38c6e8ae8b04fec292cbe99
      486ac4ba
  7. 18 Jan, 2017 1 commit
    • Jeffrey I. Schiller's avatar
      Use the synchronous version of getBitmapDrawable · c7a02e77
      Jeffrey I. Schiller authored
      This reverts most of commit b5e78d70.
      We keep the changes to MediaUtil.getBitmapDrawable. So the actual image
      fetching happens on a non-UI thread, but the UI Thread blocks until the
      network I/O is done. This is non-ideal, as blocking on the UI thread can
      result in an Application Not Responding (ANR) error. However this might
      be more desirable then having the application apparently not load a
      background image for a long time, and then having it suddenly appear
      when the background network loading is finally finished.
      
      Change-Id: I3424918a83284d19ee6ccfc9deb8824f5c0605a2
      c7a02e77
  8. 12 Jan, 2017 1 commit
    • Evan W. Patton's avatar
      Make MediaUtil.getBitmapDrawable asynchronous · b5e78d70
      Evan W. Patton authored
      When the minSdkVersion is >= 10 and the user attempts to set an image
      to a non-file URL, the Android runtime will throw an
      android.os.NetworkOnMainThreadException. This commit changes the
      behavior of MediaUtil.getBitmapDrawable to an asynchronous design that
      takes a callback that will be triggered after the bitmap has been
      loaded. If an exception occurs, an onException callback will be
      used. Other failures are reported via the onFailure callback. Due to
      the change to AsyncCallbackPair, this change also affects a number of
      other components that may or may not have been performing network
      access on the main thread.
      
      Testing of this change should focus on the following components:
       * ButtonBase and its descendants
       * Canvas
       * Form
       * GameClient
       * HVArrangement and its descendants
       * Image
       * ImageSprite
       * MediaStore
       * TinyWebDB
       * Voting
      
      Change-Id: Ib9bd0a0a929b26ad44eeda58a7c637398dd70219
      b5e78d70
  9. 31 Dec, 2016 1 commit
    • Evan W. Patton's avatar
      Fix SoundRecorder crashing on Start method call · 8cbe40cf
      Evan W. Patton authored
      Reported by the forum posting [1], the SoundRecorder crashes when the
      Start method is called. After some debugging, this is due to
      unexpected values being reported via the onInfo method being called
      with an unexpected, non-documented value of `what`. The code always
      called controller.recorder.stop(), but since the MediaRecorder hadn't
      transitioned to the recording state yet, stop() throws an uncaught
      IllegalStateException, which kills the program.
      
      This commit makes the onInfo method more robust by reporting known
      `what` values via dispatchErrorOccurredEvent and ignoring any values
      not declared by AOSP. It also adds a call to StoppedRecording()
      otherwise the app may not have been aware of the failure state.
      
      [1] https://groups.google.com/d/msg/mitappinventortest/qMPzn5s82UY/LJu8znfrAwAJ
      
      Change-Id: Ifd12fcf016df07b500b958bd4900781bf6ff6c47
      8cbe40cf
  10. 12 Dec, 2016 1 commit
    • hal's avatar
      Add the “ShowListsAsJson” Property · 160f16c0
      hal authored
      When set this property causes lists to be displayed in JSON notation
      rather then Lisp notation. Its default value is “false” so current
      projects continue to work and new projects will still use Lisp
      format. This can be changed in the future once the Companion that
      supports ShowListsAsJson is widely deployed.
      
      Change-Id: I2e6b25c32d27377685eb8111f44536479e7c55b7
      160f16c0
  11. 08 Dec, 2016 2 commits
  12. 06 Dec, 2016 1 commit
  13. 23 Nov, 2016 1 commit
    • Evan W. Patton's avatar
      Add check for open project before prompting user · db222616
      Evan W. Patton authored
      There is a prompt for the user to create or open a project. However,
      this is based on whether currentFileEditor is set, which is a problem
      is a project load is in process. This commit adds a check to
      EditorManager to see if there is an editor even though
      currentFileEditor is null, in which case no prompt is shown.
      
      Change-Id: Icf044a638fef19d7fb5660a4783f852c7ccbb6cb
      db222616
  14. 19 Nov, 2016 2 commits
    • Evan W. Patton's avatar
      Cache Flag and GallerySetting state · b425deb7
      Evan W. Patton authored
      The loading of GallerySettings has a high latency in production. This
      commit makes it so that the GallerySetting object is created only once
      per GAE instance. It also updates the Flag class to cache the value on
      first read since these flags are set in appengine-web.xml and are only
      expected to change during deployment of a new version of App Inventor.
      
      Change-Id: I7bb123697e821f2510807c5cbd5671bae71db307
      b425deb7
    • Evan W. Patton's avatar
      Update GAE to 1.9.46 and GCS to 0.6 · 27f79871
      Evan W. Patton authored
      This commit updates Google App Engine and Google Cloud Storage
      libraries to the most recent versions. This fixes exceptions in the
      dev server regarding the deprecated Files API.
      
      Change-Id: Icd3883c292cfb055bb18560ca04aaf2b313ba9ba
      27f79871
  15. 18 Nov, 2016 4 commits
    • Evan W. Patton's avatar
      Hide gallery loading message after all tabs load · b777cefe
      Evan W. Patton authored
      Commit e38f54e9 deferred gallery loading until the user opened the
      gallery. This commit provides more complex logic for managing the
      "Loading..." messages shown during loading of the gallery by counting
      the number of tabs that have loaded content. In the earlier commit, if
      the primary tab wasn't loaded the message would go away if one of the
      non-visible tabs finished loading. Now the loading message will only
      go away if all tabs have loaded their content.
      
      Change-Id: I019891c4b3160f91658f43ad1d42f47e00cffd32
      b777cefe
    • Evan W. Patton's avatar
      Update settings on server only if changes occur · e066dc0e
      Evan W. Patton authored
      Switching between tabs will save settings even if nothing has
      changed. This results in more network operations than is necessary to
      maintain correct behavior of the application.
      
      This commit updates the CommonSettings class hierarchy to record when
      changes have been made. UserSettings and ProjectSettings will perform
      RPC if and only if the changed flag is true. Otherwise, saving
      settings is a no-op.
      
      Change-Id: I1f15d39418036b320ee3050003034b97e46415be
      e066dc0e
    • Evan W. Patton's avatar
      Cache client checks for android.keystore · 09591fd8
      Evan W. Patton authored
      Only certain actions modify the state of android.keystore on the
      server. The keystore can only change if a new one is imported, the
      current keystore is deleted, or when no keystore exists but the user
      builds an app. However, this is not reflected in the flow control of
      App Inventor. Switching between projects, for example, will check for
      the state of android.keystore even though this is a user file not a
      project file, and the state of the android.keystore will be invariant
      between projects.
      
      This commit caches the result of checks for android.keystore to reduce
      the number of round trips to the server and only rechecks when an
      action may result in an update to the status or in the event an
      earlier call to hasUserFile fails.
      
      Change-Id: I65df499d509ea7098f6b349d0da09cdaea84dd08
      09591fd8
    • Jeffrey I. Schiller's avatar
      Reduce logging and improve static files loading · 93c6bccc
      Jeffrey I. Schiller authored
      Reduce logging so only anomalous situations result in log entries (you
      can turn logging back on by setting appinventor.debugging to true in
      appengine-web.xml).
      
      Disable App Stats, as it really isn’t needed in production.
      
      Provide reasonable caching and expiration on some static files,
      including making sure they are served statically (this is required when
      removing App Stats).
      
      Change-Id: I84bd4877a2cbeba79f7da9248919920ea27c499b
      93c6bccc
  16. 15 Nov, 2016 1 commit
    • Evan W. Patton's avatar
      Defer gallery loading until user chooses to open it · e38f54e9
      Evan W. Patton authored
      Daily we have 750,000+ requests for resources via /ode/gallery. These
      requests occur even if the user never actually accesses the gallery
      since they are done at initialization of Ode. This commit defers the
      initialization of the gallery UI so that it is only generated once the
      user accesses the gallery.
      
      Change-Id: Ic16ae5f45c8f79570d763408f5958170fa332ae1
      e38f54e9
  17. 08 Nov, 2016 1 commit
    • Evan W. Patton's avatar
      Fix logic bug in ReplMgr when no assets are present · f20f55c7
      Evan W. Patton authored
      Commit 72e0ca15 added a callback to handle loading of assets to the
      Companion. However, if the Companion is connected to a project without
      assets, the callback to switch from ASSET state to CONNECTED state
      will never fire. This commit checks whether the asset map has 0
      elements, in which case it will synchronously fire the callback so
      that projects without assets will immediately transition to CONNECTED
      state.
      
      Change-Id: Iba12232966752ed9cb61af0f97aa16ebcffeed4a
      f20f55c7
  18. 07 Nov, 2016 2 commits
  19. 04 Nov, 2016 1 commit
    • Jeffrey I. Schiller's avatar
      Fix Race Condition in Asset Loading · 72e0ca15
      Jeffrey I. Schiller authored
      Asset loading is performed asynchronously and usually happens
      quickly. However with many or large assets, the transferring of the
      asset to the device (or emulator) may not finish in time, resulting in
      an error and a re-try (which eventually succeeds).
      
      We re-factor the asset transferring code to properly handle its
      asynchronous nature using appropriate callbacks.
      
      Change-Id: Idf0170d9a6d929a7ca964b3852811b2b09dc49ce
      72e0ca15
  20. 30 Oct, 2016 2 commits
    • William S. Byrne's avatar
      Added support for activity starting from any component. · c976f01e
      William S. Byrne authored
      Summary:
      Using the @ActivityElement and @UsesActivities annotations, it is now
      possible to launch an arbitrary activity from a component without
      hacking Compiler.java to register that activity in AndroidManifest.xml.
      
      Using the @ReceiverElement and @UsesBroadcastReceivers annotations, it is
      now possible to leverage the full functionality of the Android
      framework when creating <receiver> elements in AndroidManifest.xml.
      
      Both of these new annotations allow App Inventor component developers
      to add <intent-filter> and <meta-data> subelements to activities and
      broadcast receivers declared in AndroidManifest.xml with the
      @IntentFilterElement and @MetaDataElement annotations.
      
      -ListPicker has been refactored to use these new annotations.
      -BarcodeScanner has been refactored to use these new annotations.
      -Twitter has been refactored to use these new annotations.
      -Texting has been refactored to use these new annotations.
      -Since the NearField component makes changes to the main activity contingent
       on information that is only available at build time, Form and NearField
       cannot be refactored to use these annotations at the moment.
      -New unit tests for broadcast receiver and activity generation were added in
       com.google.appinventor.buildserver.CompilerTest.java.
      -Added legacy support for the deprecated @SimpleBroadcastReceiver annotation
       so that we don't break extensions that are currently using it.
      
      Change-Id: I2114f2b522bdbcf51e1e1b79a642010ff040e183
      c976f01e
    • Evan W. Patton's avatar
      Disable suggestions in TextView · 2ad58dd7
      Evan W. Patton authored
      This commit disables suggestions in the TextView, which appears to
      crash the Companion on Android 7+ due to missing layouts.
      
      Change-Id: I932f5aeaded2584e80f1e2e512e401000a7214ed
      2ad58dd7
  21. 21 Oct, 2016 1 commit
  22. 21 Sep, 2016 1 commit
  23. 19 Sep, 2016 1 commit
    • Evan W. Patton's avatar
      Fix erroneous reference to getProcedureDef · 54611776
      Evan W. Patton authored
      When changing the called procedure name in a procedure block that
      returns a value, the parameter sockets disappear and the block becomes
      unusable. This is caused by the fact that the code looks to call
      getProcedureDef but it is undefined, even on procedure blocks. The
      issue was that it is supposed to be copied from the no return version
      of the procedure call block, but the reference was wrong and so the
      value was undefined. This commit fixes the erroneous reference in
      order that the behavior is correct. This also has the side effect of
      fixing the (unreported?) bug that the "Highlight Proceduce" context
      menu action was not working due to the same issue.
      
      Fixes #844
      
      Change-Id: I7041c3ab05a89c1a710128a7d91a543bb601940a
      54611776
  24. 14 Sep, 2016 2 commits
  25. 06 Sep, 2016 1 commit
  26. 29 Aug, 2016 1 commit
    • Jeffrey I. Schiller's avatar
      Mitigate Race Condition · 17b61875
      Jeffrey I. Schiller authored
      Mitigate a Race Condition where blockly reads the component database
      before the project has finished initializing the component
      database. This race only tends to manifest in projects with several (or
      many) screens each of which have a significant number of blocks.
      
      Change-Id: I073c4fb30a522d59e6ba060b39183798ce9ac10e
      17b61875
  27. 27 Aug, 2016 3 commits
    • Jeffrey I. Schiller's avatar
      Fix Android Servlet · f26f6a03
      Jeffrey I. Schiller authored
      Android Servlet let’s you download your packaged apps to your own
      device.
      
      Change-Id: I1b074fc65591642e8e8e9fe468609cd6a7d5af2b
      f26f6a03
    • Jeffrey I. Schiller's avatar
      Remove Obsolete Code · 9325bf0a
      Jeffrey I. Schiller authored
      Remove code that was used to communicate with the AI Classic Blocks
      editor. It is no longer in use.
      
      Change-Id: I5a1dc1e3a4081723a74c4370265158f29cd4ae34
      9325bf0a
    • hal's avatar
      Add VR paper writeup · e2303697
      hal authored
      Change-Id: I1d50c87acab77adc301b551ee32570d81a7a90f7
      e2303697
  28. 23 Aug, 2016 1 commit
    • Evan W. Patton's avatar
      Update ActivityStarter to use TextUtils.isEmpty(String) · 8da740e6
      Evan W. Patton authored
      ActivityStarter uses String.isEmpty(), which was introduced in Java
      1.6. However, older versions of Android are only binary compatible
      with Java 1.5, such as the version used in the emulator. This causes
      the ActivityStarter to throw an exception when starting an activity.
      
      This commit fixes the issue by replacing the call to String.isEmpty()
      with android.text.TextUtils.isEmpty(String), which is available since
      Android API version 1. This is consistent with other checks in
      components, such as Canvas and Web.
      
      Closes #827
      
      Change-Id: I5c26bab97421a86b3d62888af447d999af38450a
      8da740e6
  29. 21 Aug, 2016 1 commit
    • Jeffrey I. Schiller's avatar
      Do not erase UserSettings when App Inventor Closed · 412e928e
      Jeffrey I. Schiller authored
      There is a race condition where if App Inventor is closed (browser
      window closed) while the system is still initializing, the user’s global
      settings will be over-written by an empty settings object because the
      global settings have not finished loading. We detect that with this code
      and avoid over-writing the settings.
      
      Change-Id: Icfcf8204b860984bf36e2a7d525ebf5814a2ffd8
      412e928e