pileproject / drive Goto Github PK
View Code? Open in Web Editor NEWThe drive project
License: Other
The drive project
License: Other
For example, #41 has no changes on codes ( changes only on README.md ). But Travis fails randomly.
This is a note to improve drive
.
I heard that some people want to use more blocks while making programs but the screen is not large enough to do so.
I propose to implement a function that allows users to scroll the page and add more blocks.
The position of the trash box is somewhat debatable because we should take care not to move the trash box while scrolling.
We are discussing who should keep keys
in #30 and considering the way of launching an activity that needs keys as arguments.
何が必要で何が必要でないかちゃんと考える
Discussed on #38
This is a proposal issue for introducing DI container (Dependency Injection)
For diverse opinions, please feel free to leave any comment, @amiq11.
...ActivityBase
and Flavor...Activity
...ActivityBase
into common logic and flavor-specific logicCurrently we are going to implement product flavors.
There are two main features of product flavors: determining java files and merging xml.
(You can skip below 2 sections if you know product flavors)
With product flavors, you can change files (or classes) by placing corresponding directories;
suppose you define 2 flavors (flavor1
, flavor2
) and have flavor1/java/com/example/Test.java
, and flavor2/java/com/example/Test.java
,
and the code in main/java/com/example/Main.java
refers to Test
class,
then the Test
class is referred with accordance of the product flavor in build-time.
You can define AndroidManifest.xml
files for each product flavor and one main
.
main
does not belong to flavors, but it defines common resources (xml, java, images).
If you have AndroidManifest.xml
in main
and flavor1
, Android Studio merges the two xml files in build-time.
Why this is useful is that you can change resources according to the flavor.
A launch activity is defined in the manifest xml file. So you can choose the launch activity
by defining the manifest xml in the flavor.
Why this feature is needed for us is because:
That's why we are going to use productFlavors.
We have nxt
, ev3
, and pile
robots so we'll have 3 product flavors.
In our current code, we we define TitleActivity
for each flavor and specify launch activities in manifest xml files for each flavor.
With the xml files, the launch activity of each app can start properly.
And for programming (block-manipulation) and execution (communication with robots) activities,
we define ProgrammingActivityBase
and ExecutionActivityBase
respectively,
and then in each flavor these classes are inherited according to the flavor (e.g., for nxt
, NxtProgrammingActivity
and NxtExecutioinActivity
).
The code of ProgrammingActivityBase
is like below:
public abstract class ProgrammingActivityBase extends Activity {
/* these methods are implemented in concrete classes */
protected abstract Intent getIntentForBlockList();
protected abstract Intent getIntentForExecution();
/* the rest is common for all flavors */
private void goToExecution() {
Intent intent = getIntetnForExecution();
...
}
...
};
Then in NxtProgrammingActivity
is like below:
public class NxtProgrammingActivity extends ProgrammingActivityBase {
@Override
protected Intent getIntentForBlockList() {
return new NxtBlockIntent();
}
@Override
protected Intent getIntentForExecution() {
return new NxtExecutionIntent();
}
}
What I am concering is that the structure seems awkward and the base classes are too huge for abstract class.
In my opinion, the straightforward way for this situation is that defining interface for flavor-specific logic (intent-provider for programming)
and injecting flavor-specific-implementation into the interface.
So what I want to suggest is like below:
public class ProgrammingActivity extends Activity {
private IntentProvider intentProvider;
private void goToExecution() {
Intent intent = intentProvider.forExecution();
...
}
}
public interface IntentProvider {
Intent forExecution();
}
public class NxtIntentProvider {
@Override
public Intent forExecution() {
return ...
}
}
By splitting code like above, the code gets
And this proposal also solves #31.
If you feel my proposal sounds good, you might wonder how the interfaces are injected
.
That kind of problems are called Dependency Injection.
There are a number of pages describing this problem, so please google it.
For Android projects, there is a cool DI container called Dagger2.
So I want to use this for our android project.
I tested the feasibility of my proposal in here
By using Dagger2, the code would be like below:
public class ProgrammingActivity extends Activity {
@Inject
IntentProvider intentProvider;
/* same as above */
}
How cool, isn't it?
Thank you for reading this too long issue.
テストがほとんどない
I don't know why but apps won't work with AndroidStudio 2.1 (Run -> Run 'app') in my environment. If you also meet the situation, please try this command to install apps (this is for NxtDrive);
./gradlew clean assembleNxtDebug installNxtDebug
This came to occur after updating a library but the cause may be something related to my development environment.
rejasupotaro/kvs-schema#20
navigation drawer で項目 ( save program など)を選ぶと,選んだ部分が灰色で選択されたことがわかるんですが,もう一度 drawer 開いた時に,その灰色の選択がそのまま残っています
いくつかのファイルで文字列定数が残っている
I found the images of help instructions are outdated like this:
and the current block design is like this;
Of course, the proposal is to fix it but the implementation was not flexible. Actually, the above image is real image
not a view.
Should we change the implementation from images to views (xml)? What do you think?
The drive application does not have a copyright notice.
I will gather notices from external libraries and show them in SettingActivity.
We use a raw Thread to execute programs (See ExecutionThread). We plan to replace it with another modern way (TBD).
I know I am a careless man who makes many bugs but #46 has too many bugs I expected and what made the matter worse, they hadn't been checked for a long time. So, I propose that we think about testing more seriously. Even if old codes somehow work, I think they also need tests to add changes to them.
NXT and EV3 have wifi communication function.
But this app does not support WiFi connecting function.
There seem to be some demand for wifi communication between this app and robots.
So in this issue I leave some notes for implementing the function.
We have to consider how the machine to be connected is specified by this app.
One possible and apparently easiest way is to input the machine's IP address directly by a user.
We have to survey whether it is possible to scan machines.
We have to implement WiFiCommunicator
, a concrete class of ICommunicator
and the counterpart of BluetoothCommunicator
.
Also WiFiMachineSelectFragment
and its related classes are needed to be implemented.
We have to modify some bluetooth-dependent code in
ExecutionActivity
ProgrammingActivity
The other classes seem not to have to be modified.
This came from a discussion on #51 .
Our apps have NumberTextHolder
and we set the initial value of it as 0
for time in the default strings.xml
. However, it seems to be surprising for users because the value becomes, for example, 0.000
(i.e., it has more precisions) after changing its value.
In the current implementation, we should stick to 0
not 0.000
because there is a locale problem (e.g., in French, 0.000
should be 0,000
) and this causes a conversion exception.
As @Myusak suggested in the discussion, we can fix it by setting initial values in NumberTextHolder
s' constructor according to the Preference of their precision (this is a new feature). So, let's make such preference!
あってもよいが,特別必要ではない
現在の ControllerBuilder では,接続されていないものは null が入っているが,
値を取得しようとすると null pointer exception で落ちるので何かしらの対処が必要
(Userの問題ではないので例外終了はおかしい).
Drive
has some Javadocs but we don't have a good way to generate them.
Do Javadocs generation as a task of Gradle. It should be something like this;
./gradlew generateNxtJavadocs
Please add comments/javadocs and then check files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.