Giter Club home page Giter Club logo

novoda / spikes Goto Github PK

View Code? Open in Web Editor NEW
542.0 55.0 131.0 142.15 MB

Where ideas & concepts are born & incubated

License: Other

Java 60.07% Shell 0.20% Groovy 2.69% HTML 4.01% CSS 2.28% JavaScript 7.09% Scala 0.57% Kotlin 15.49% Objective-C 0.37% Swift 3.87% Ruby 0.68% TypeScript 0.14% GLSL 0.84% Dockerfile 0.06% Makefile 0.05% Starlark 0.07% AIDL 0.71% Jupyter Notebook 0.82% Procfile 0.01%
spike novoda open-source java android ideas proof-of-concept

spikes's Introduction

Spikes

Novoda

This is where we explore new ideas, hack around bug fixes and spark new code babies.

Each top-level folder in this repository represents a spike that the Novoda team has worked on at some point in time. Explore the folder contents to find out more about these spikes.

Graduating out of spikes

When something matures and becomes big enough to deserve its own repository, Novodians can split out the history of that project's folder into a new repository. If something isn't big enough to deserve its own repo it should be moved to android-demos or ios-demos.

License

All the contents of this repository are (c) Copyright Novoda. Sub-folders that don't specify a license explicitly are implied to offer their contents under the Apache 2.0 licence:

    (c) Copyright Novoda

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

spikes's People

Contributors

amlcurran avatar ataulm avatar bertadevant avatar blundell avatar danybony avatar dependabot[bot] avatar devisnik avatar dorvaryn avatar eduardb avatar flo-genymobile avatar florianmski avatar frapontillo avatar friedger avatar gbasile avatar jozefceluch avatar juankysoriano avatar lgvalle avatar meghankane avatar miwierzbinski avatar mr-archano avatar muardle avatar ouchadam avatar rock3r avatar stylingandroid avatar takecare avatar tasomaniac avatar tobiasheine avatar tokou avatar xrigau avatar zegnus 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spikes's Issues

[monkey-runner] Install MonkeyTrap app automatically

It'd be nice if the plugin did this for you. Perhaps the apk should be bundled with the plugin and then before running the monkey tasks, if the app is not installed (or if it's an older version), it would install it automagically โœจ .

plane detection

Thank you for your explanation in details on the web. It really helps me a lot!
I understand the rendering parts, but may I have any chance to ask where's the code for plane detection?

MonkeyTrap crashes on background

MonkeyTrap randomly crashes on the background with a NPE.

I suspect that it is because service gets killed and redelivered with null intent.

 java.lang.RuntimeException: Unable to start service com.novoda.monkeytrap.OverlayService@316705a7 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.getBooleanExtra(java.lang.String, boolean)' on a null object reference
E/AndroidRuntime(22174): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2911)
E/AndroidRuntime(22174): at android.app.ActivityThread.access$2100(ActivityThread.java:151)
E/AndroidRuntime(22174): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
E/AndroidRuntime(22174): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(22174): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(22174): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(22174): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(22174): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(22174): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(22174): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime(22174): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.getBooleanExtra(java.lang.String, boolean)' on a null object reference
E/AndroidRuntime(22174): at com.novoda.monkeytrap.OverlayService.shouldShow(OverlayService.java:68)
E/AndroidRuntime(22174): at com.novoda.monkeytrap.OverlayService.onStartCommand(OverlayService.java:62)
E/AndroidRuntime(22174): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2894)
E/AndroidRuntime(22174): ... 9 more

[monkey-runner] Plugin not working for Gradle 3.5

It seems the plugin doesn't work with newer versions of gradle. I've done my tests with 3.5

The problem happens on configureTask:

def monkeyTask = project.task("runMonkeyDevice${index}", type: TargetedMonkey) {
    packageName = extension.packageNameFilter
    adb = android.command.adb
    deviceId = device.id
    logFileName = extension.logFileName
    monkey = [events: extension.eventsCount, categories: extension.categories]
}

It fails with this error:

> Could not set unknown property 'adb' for task ':ccleaner:runMonkeyDevice0' of type com.novoda.monkey.TargetedMonkey.

The property adb is defined in the class AdbTask: TargetedMonkey -> Monkey -> AdTask
So it should be visible in this scope, but for some reason, it is not.

The same problem is happening with the property monkey


This problem can be reproduced in the sample project that comes with the monkey-runner plugin just by upgrading its gradle dist version

TpBot feature flags

Problem

It is becoming increasingly more tedious and difficult to manually test tpbot because all of the features are on by default, this includes:

  • Opening accessibility service settings automatically
  • Automatically joining a hangout
  • Connecting to the tpbot server

Solution

Implement a series of android menu items backed by shared preferences to control each of the individual features.

[espresso-support] Compatibility with Espresso 3.0.0 and Test Support Library 1.0.0

When using espresso-support v0.2.0 together with Espresso 3.0.0 and test Support Library 1.0.0 every test using ViewTestRule crashes with the following exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Intent.putExtra(java.lang.String, int)' on a null object reference
    at com.novoda.espresso.ViewTestRule.getActivityIntent(Unknown Source:8)
    at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(Unknown Source:49)
    at org.junit.rules.RunRules.evaluate(Unknown Source:2)
    at org.junit.runners.ParentRunner.runLeaf(Unknown Source:8)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(Unknown Source:18)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(Unknown Source:2)
    at org.junit.runners.ParentRunner$3.run(Unknown Source:6)
    at org.junit.runners.ParentRunner$1.schedule(Unknown Source:0)
    at org.junit.runners.ParentRunner.runChildren(Unknown Source:25)
    at org.junit.runners.ParentRunner.access$000(Unknown Source:0)
    at org.junit.runners.ParentRunner$2.evaluate(Unknown Source:4)
    at org.junit.runners.ParentRunner.run(Unknown Source:13)
    at org.junit.runners.Suite.runChild(Unknown Source:0)
    at org.junit.runners.Suite.runChild(Unknown Source:2)
    at org.junit.runners.ParentRunner$3.run(Unknown Source:6)
    at org.junit.runners.ParentRunner$1.schedule(Unknown Source:0)
    at org.junit.runners.ParentRunner.runChildren(Unknown Source:25)
    at org.junit.runners.ParentRunner.access$000(Unknown Source:0)
    at org.junit.runners.ParentRunner$2.evaluate(Unknown Source:4)
    at org.junit.runners.ParentRunner.run(Unknown Source:13)
    at org.junit.runner.JUnitCore.run(Unknown Source:25)
    at org.junit.runner.JUnitCore.run(Unknown Source:4)
    at android.support.test.internal.runner.TestExecutor.execute(Unknown Source:20)
    at android.support.test.runner.AndroidJUnitRunner.onStart(Unknown Source:120)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2074)

I think the problem is in ViewTestRule:25. There we rely on super.getActivityIntent() to return a valid Intent we can continue to work with. In the version of Test Support Library currently depended on, this is totally fine (we depend on espresso-core 2.2.2 which in turn depends on Test Support Library 0.5.0). However, Test Support Library 1.0.0 changed its behavior and now the default implementation of super.getActivityIntent() just returns null resulting in the above crash.

A possible solution would be to replace the line with:

Intent intent = new Intent(Intent.ACTION_MAIN);

Cannot import to project

When trying to sync project with compile 'com.novoda:drop-cap:1.1.0' this error occured. What's wrong?

Error:(32, 13) Failed to resolve: com.novoda:drop-cap:1.1.0

TpBot architecture diagram

Problem

The TpBot project is becoming quite large with a number of small components that all operate together to make TpBot work. Now would be a good time to show how, from a high level, these components link together.

Solution

Consider using https://github.com/structurizr/java to create an architecture diagram.

Technical Data Questionnaire Wiki Page

Problem

We want to show our reasoning as to why someone would want to use this particular library and the challenges we have faced with each release. To this end, we have created a Technical Data Questionnaire. This Questionnaire is cloned from novoda/novoda.

Solution

Here's a template, created from the Gradle Build Properties Plugin, that can be used to create a Data Questionnaire for this repository. The Data Questionnaire should be added to this Repository's Wiki Section.

Template

Overview of the project. What are its technical capabilities compared to the industry standard?

Development of a plugin system for open source applications that require private keys and configs to be ran but these should not be shared in public locations. for example an analytics library that needs a key to login to the system but not all people should access to this key. The project focuses on making the possibility of adding private information as seamless as possible, so that the projects can be used simply but not expose information. This offers features not available currently on the market and although other variations of this technique are possible they do not make the solution quite as easy.

What platforms and tools did you use to make it? (encouraged to namedrop components/languages/databases etc)

Groovy, Gradle for development, Guava, Truth and Findbugs for testing

Describe, in detail, the technical challenges faced (specifically what development required more than routine techniques) and what was engineered to overcome them?

It is really important to discuss the iterative journey to explain at each stage of production (each release) what was engineered.

Write this as if you are explaining the challenges to a technical colleague.

Attempt to write at least four paragraphs that cover these points:

  • Technical advances
  • How uncertainties were overcome
  • Any iterative approaches
  • Final solution

Currently to solve the problem of not sharing private keys, developers would cut and paste when they were needed for production and a lot of human interaction was needed to keep these keys private, but still useful. Many repositories would require five or more keys, therefore it required coordination with the build system to make sure each was put in the right place and used at the right time. The gradle build properties plugin automates all of this and allows you to drop in one file, that is read by the gradle system and pulls out the properties or keys and puts them in the right place. This is a technical advancement on any of the current solutions as before it was not centralised or automated meaning keys where in many different places and the chance for security issues was high. With this centralised solution it can allow us to keep all the keys in a secure place and use security credential to access them at the time needed.

A big uncertainty was our knowledge around connecting a remote secure location for the keys to the build system that would be using them. We did not know if we could access or communicate with a secure system in a timely fashion that would allow for the normal build process. This uncertainty was overcome through investigating distribution systems based on maven repositories. With this investigation it was found two way secure communication could happen and therefore we could separate the private keys from the public repository.

When injecting the private keys into a gradle build it has to be done at the correct step. With the creation of this plugin we were unsure in our knowledge of gradle plugins and where we would hook into the build system. This problem was overcome with the development approach of investigating other gradle plugins, this lead us to the Android plugin that also hooks in for other reasons, and we adapted and expanded on this knowledge to allow our key injection to work.

The first approach was to load from a local properties file, take the keys from a separate file, this split apart building and key loading. The second was being able to override at runtime any errors, therefore giving fallback strategies if keys were not available. For example if the properties file was missing a private key, the key could also be set as a system property and we could now fallback from one to the other in a recursive fashion. We then added other fallbacks for secondary files, command line and hard coded values. We then iterated again to allow for the fallback file to be a remote file and take security credentials to open or load it.

The final solution now allows for developers to create open source repositories that use private keys without them needing to be public. The integration is as simple as defining a file, that is not checked into version control but can be in one of multiple places, and then providing fallback strategies if this secure file is not there, for example providing fallback debug keys that can be public and checked into the repository. This simplified any developers use of private keys in a public or private repositories and will likely lead to a decrease in their time spent in this area by a factor of 10x.

Terminate Hangout on human disconnect

Problem

Currently, a Bot will be permanently part of a hangout when first installed, even if the human has disconnected.

Potential Solution

Monitor for human connect and disconnect events, using these to open and close a Hangout.

Impact

We won't be unnecessarily keeping a Hangout open when a user disconnects.

Create tests for webClient

Problem

A replacement for the current socket io based server has been created but thus far it is untested! ๐Ÿ˜ฑ

Potential Solution

This needs to be fully tested before a switch can be made.

Impact

We will be able to switch between the two clients with confidence that the behaviour has remained the same.

Can't get enews module working :-)

https://github.com/novoda/spikes/tree/master/enews

I can't work out how to run the enews html generator.

i have Intellij Ultiimate edition with the node plugin.

When I run the demo.js I get:

Error: Cannot find module 'enews-fetcher'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/blundell/Dev/git-repo/spikes/enews/html-generator-node/demo.js:1:82)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)

Can you update the readme for the module / modules to explain how I import it into Inteillj and what magic build config settings I have to add?

RFC: Introduce fallback support for `BuildPropertiesPlugin`

Scope

While trying to integrate the current version of BuildPropertiesPlugin in some internal project we realised that we should consider having support for fallback values, eg:

String value = buildProperties.secrets['foo'].or(buildProperties.other['bar']).string

Ideally we could provide support also to closures and plain values, eg:

Double value = buildProperties.config['rate'].or({ Math.random() }).double

or

Double value = buildProperties.config['rate'].or(1.0).double

Considerations/Implementation details

A simple implementation would introduce a Entry.or(def other) method, creating a new Entry where the value closure will be evaluated considering the provided fallback. E-Z.

Couple of considerations more:

  • It would be nice to get access to project properties and system environment variables via a predefined set of entries in buildProperties. What if we had buildProperties.project and buildProperties.env to access them? eg:
buildProperties.project['foo']
buildProperties.env['BAR_PATH']
  • At the moment it's possible to override the value of a property via command line. What about removing this feature in favour of a more explicit support via or()? eg:
buildProperties.project['foo'].or(buildProperties.secrets['foo'])
  • When trying to access a property in a Properties file an error is thrown. We need to consider the error handling as part of the implementation of the Entry.or() to bubble up a meaningful error when the whole chain of fallbacks evaluates to null. An alternative would be to always fallback to null if a property is not available, any thoughts?

It would be great to collect some feedback and brainstorm possible solutions to the issues above.

Rename TP project to follow NOS convention

Problem

Currently, the app is called TelepresenceBot which does not follow NOS project naming conventions.

Potential Solution

To follow NOS conventions it should be lowercase with spaces represented with dashes e.g. tp-bot or telepresence-bot.

Impact

Very little impact except that it will make finding our repository easier if the naming always matches.

Hook up webClient to SocketIO

Problem

A dummy webClient has been created for the human allowing a bot to be controlled from a web browser. This has not been hooked up with SocketIO preventing commands being sent to the bot.

Solution

Hook up the webClient with SocketIO.

Impact

  • Able to send commands from a web browser to a connected bot without the need of the dedicated android app.

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.