opensource.google.com

Menu
Showing posts with label ios. Show all posts
Showing posts with label ios. Show all posts

Open sourcing Science Journal iOS

Thursday, March 28, 2019



Google’s Science Journal app enables you to use the sensors in your mobile devices to perform science experiments. We believe anyone can be a scientist anywhere. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone. From learning about sound and motion to discovering how atmospheric pressure works, Science Journal helps you understand and measure the world around you.

We’re extremely excited to announce that we’re open sourcing this powerful science tool. We know the heart of science is not just critical thinking, but also knowledge sharing, building on discoveries, and learning about the world. Have a student with a knack for building things? Do you want to learn how mobile applications are put together? Download our source code, make changes and discoveries, and then deploy the newly-modified app to your own iOS device.

Why open source?

Inquiring minds are always asking, “How does this work?” With our open source app, there are many science and engineering topics to explore! For example, we use the Fast Fourier transform in our iOS code, but you may ask “how did you do that?” Because you can see our source code, you can discover-- not just that we used the Fast Fourier transform-- but how the algorithm works. We also make it possible to graph many sensor values in realtime and now you can see exactly how we’ve made that possible.

If you aren’t an iOS or Android engineer, don’t fret! You can even learn how apps are put together so you can build your own. Learning from, and making modifications to, open source code has helped countless Google engineers explore complicated topics and learn new skills.



Have you ever wished you could do something with Science Journal that it doesn’t currently do? Do you have an idea for building a new sensor and displaying its data in Science Journal? Maybe you’ve wanted to experiment with changing colors or fonts in the app, or even changing the Science Journal app icon to be a labrador with a lab coat? Now you can, by forking our repo, making changes, and committing them in your fork!

If you think your changes are amazing and should be included in Google’s Science Journal App, read our contribution guide. But if you want to keep your changes to yourself and your friends, well, that’s cool too! We’d love to see what you’ve built, so you can tweet at us @GScienceJournal, or just use the #myScienceJournal hashtag on Twitter.

By Joshua Liebowitz, iOS Tech Lead

iOS Accessibility Scanner Framework

Wednesday, March 13, 2019

At Google, we are committed to accessibility and are constantly looking for ways to improve our development process to discover, debug and fix accessibility issues. Today we are excited to announce a new open source project: Accessibility Scanner for iOS (or GSCXScanner as we lovingly call it). This is a developer tool that can assist in locating and fixing accessibility issues while an app is being developed.

App development can be a time consuming process, especially when it involves human testers. Sometimes, as in the case with accessibility testing, they are necessary. A developer can write automated tests to perform some accessibility checks, but GSCXScanner takes this one step further. When a new feature is being developed, often there are several iterations of code changes, building, launching and trying out the new feature. It is faster and easier to fix accessibility issues with the feature if they can be detected during this phase when the developer is working with the new feature.

GSCXScanner lives in your app process and can perform accessibility checks on the UI currently on the screen simply with the touch of a button. The scanner’s UI which is overlaid on the app can be moved around so you can use your app normally and trigger a scan only when you need it. Also, it uses GTXiLib, a library of iOS accessibility checks to scan your app, and you can author your own GTX checks and have them run along with scanner’s default checks.

Using the scanner does not eliminate the need for manual testing or automated tests, these are must haves for delivering quality products. But GCSXScanner can speed up the development process by showing issues in app during development.

Help us improve GSCXScanner by suggesting a feature or better yet, writing one.

By Sid Janga, Central Accessibility Team

Open sourcing GTXiLib, an accessibility test automation framework for iOS

Wednesday, March 21, 2018

Google believes everyone should be able to access and enjoy the web. We share guidance on building accessible tech over at Google Accessibility and we recently launched a dedicated disability support team. Today, we’re excited to announce that we’ve open sourced GTXiLib, an accessibility test automation framework for iOS, under the Apache license.

We want our products to be accessible and automation, with frameworks like GTXiLib, is one of the ways we scale our accessibility testing. GTXiLib can automate the process of checking for some kinds of issues such as missing labels, hints, or low contrast text.

GTXiLib is written in Objective-C and will integrate with your existing XCTests to perform all the registered accessibility checks before the test tearDown. When the checks fail, the existing test fails as well. Fixing your tests will thus lead to better accessibility and your tests can catch new accessibility issues as well.
  • Reuse your tests: GTXiLib integrates into your existing functional tests, enhancing the value of any tests that you have or any that you write.
  • Incremental accessibility testing: GTXiLib can be installed onto a single test case, test class or a specific subset of tests giving you the freedom to add accessibility testing incrementally. This helped drive GTXiLib adoption in large projects at Google.
  • Author your own checks: GTXiLib has a simple API to create custom checks based on the specific needs of your app. For example, you can ensure every button in your app has an accessibilityHint using a custom check.
Do you also care about accessibility? Help us sharpen GTXiLib by suggesting a check or better yet, writing one. You can add GTXiLib to your project using CocoaPods or by using its Xcode project file.

We hope you find this useful and look forward to feedback and contributions from the community! Please check out the README for more information.

By Siddartha Janga, Google Central Accessibility Team 

EarlGrey: iOS functional UI testing framework

Wednesday, February 17, 2016

Brewing for quite some time, we are excited to announce EarlGrey, a functional UI testing framework for iOS. Several Google apps like YouTube, Google Calendar, Google Photos, Google Translate, Google Play Music and many more have successfully adopted the framework for their functional testing needs.


The key features offered by EarlGrey include:
  • Powerful built-in synchronization : Tests will automatically wait for events such as animations, network requests, etc. before interacting with the UI. This will result in tests that are easier to write (no sleeps or waits) and simple to maintain (straight up procedural description of test steps).
  • Visibility checking : All interactions occur on elements that users can see. For example, attempting to tap a button that is behind an image will lead to test failure immediately.
  • Flexible design : The components that determine element selection, interaction, assertion and synchronization have been designed to be extensible.

Are you in need for a cup of refreshing EarlGrey? EarlGrey has been open sourced under the Apache license. Check out the getting started guide and add EarlGrey to your project using CocoaPods or manually add it to your Xcode project file.

By Siddartha Janga, on behalf of Google iOS Developers

J2ObjC 1.0 Release

Thursday, January 21, 2016

We are pleased to announce the 1.0 release of J2ObjC, a Google-authored open-source compiler that lets iPhone/iPad applications use Java code. J2ObjC's goal is to support the sharing of an application's non-UI code (such as data access, or application logic) by writing it once in Java, then building it into the iOS application. This same code can be shared with the Android and web versions of the application (the latter using the GWT compiler), as well as with server-side code. J2ObjC is licensed under the Apache License, Version 2.0.
J2ObjC is not a Java emulator, but instead translates Java to Objective-C classes that extend the iOS Foundation Framework. It supports the Java 8 language and runtime required by client-side application developers. JUnit and Mockito test translation and execution is also supported.  J2ObjC can be used with most build tools, including Xcode and Make, and there are Gradle and Maven plug-ins.
J2ObjC does not translate user interfaces, as world-class apps need to have world-class user interfaces that adhere closely to the different iOS and Android design standards. J2ObjC instead focuses on writing common abstractions once, and verifying them with a common set of unit tests. This ensures that an app's features work the same across platforms, improving customer experiences. Teams developing multi-platform apps still need great engineers for each platform, but with J2ObjC they don't waste time rewriting each others' code.


Using continuous integration, J2ObjC helps product velocity. As each feature is added or bug fix made to the application's shared code, all platforms are automatically rebuilt and tested. And because common features are shared across platforms, a bug found on one platform is fixed once for all platforms.


Several of Google’s iOS applications use J2ObjC for these reasons, including Inbox by Gmail, Google Calendar, Google Docs, Google Sheets, Google Slides and Google My Business. Each team has dedicated iOS designers and engineers, but application logic common to all platforms is written once.

By Tom Ball, Google Engineering
.