Skip to content

Commit

Permalink
Cleanup, version 0.1.0 for play store.
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras committed Apr 7, 2020
1 parent 4ef0694 commit 320a6bc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 51 deletions.
57 changes: 12 additions & 45 deletions display_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,56 +32,23 @@ If there are problems, `flutter doctor` might be helpful. If everything works,
look like this:
![Running from Command Line](misc/flutter_run.png)

### Installation of a Debug Build - if bundletool works

This application uses Flutter, which has a significant native (non-Java)
component. Instead of an APK, applications are distributed as an "aab" file.
A tool called "bundletool" is used to generate apks, and then used again
to select the correct apk for a connected device. So to install a debug
build, the first step is to go over to https://github.com/google/bundletool/,
and get the latest release of the bundletool jar. As of this writing, that's
`bundletool-all-0.13.3.jar`. Then, make up a little shell script or whatever to run
it. Personally, I put the jar in `~/lib`, and I made a shell script like this in my
`~/bin`:
```bash
#!/bin/bash
JAR=$HOME/lib/bundletool-all-0.13.3.jar
echo "Running $JAR"
echo "cf. https://github.com/google/bundletool/"
java -jar $JAR "$@"
```
On my side, I'll build `app-release.abb` with the command `flutter build appbundle`, and I'll
generate the (huge) `.apks` file, which I'll call `breezy.apks`. (Note to self: that's done with
`bundletool build-apks --bundle=app-release.aab --output=breezy.apks`). I have to do this step, because
it signs the underlying apk files with a debug key. To install the app, download `breezy.apks`,
and do this:
```ignorelang
bundletool install-apks --apks=~/tmp/tmp/breezy.apks
```
If there are multiple devices connected, it will tell you to use `--device-id`.

### Installation of a debug build - if bundletool does not work

A more manual way of doing this that was found to work is as follows. The `.apks` file reference
above is really just a zip file that contains a bunch of APK files. So what has been found to
work is:
```ignorelang
billf@Zathras:~/tmp/tmp$ unzip breezy.apks
<... lots of output ...>
billf@Zathras:~/tmp/tmp$ mv standalones/standalone-armeabi_v7a_hdpi.apk breezy.apk
billf@Zathras:~/tmp/tmp$ adb install breezy.apk
```
The `.apk` files in the `.apks` archive are already signed. Depending on hardware, a different
standalone apk might be appropriate.

### TODO - the better way to distribute and install
### Commands used to build/deploy
```
flutter clean
flutter build appbundle
```
Then deploy to play store via internal app sharing. Or:
This makes a build for the Play Store. Alternately,
```
flutter clean
flutter build apk --split-per-abi
```
and upload to github.
makes APKs suitable for github

## Testing with a socket

The application is designed to connect to an embedded system using
a serial connection over USB. In the future, it will be extended
for Bluetooth connections. It also allows a data source to connect
a socket to the display device, which may be useful for debugging.
See [`misc/send_data_to_display.sh`](misc/send_data_to_display.sh) for a Linux script to
send a log file to the display device.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions display_app/breezy/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'package:pedantic/pedantic.dart';
import 'package:path_provider/path_provider.dart';
import 'package:connectivity/connectivity.dart'
show Connectivity, ConnectivityResult;
import 'dart:io'
show exit, stdout, File, Directory, NetworkInterface;
import 'dart:io' show exit, stdout, File, Directory, NetworkInterface;
import 'dart:convert' as convert;
import 'dart:math' show Random;
import 'serial_test.dart';
Expand Down Expand Up @@ -143,6 +142,7 @@ class _BreezyHomePageState extends State<BreezyHomePage>
Widget doBuild(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Image.asset('assets/breeze_icon_white_256x256.png'),
title: Text(widget._title),
actions: <Widget>[
PopupMenuButton<void Function()>(
Expand Down Expand Up @@ -416,7 +416,7 @@ class Settings {
result.writeln(' Baud rate: $baudRate');
result.writeln(' eight data bits, one stop bit, no parity');
result.writeln(
' meter incoming data by time (for debug): $meterData');
' meter incoming data by time (for debug): $meterData');
break;
case InputSource.screenDebug:
result.writeln(' Input from internal demo functions');
Expand All @@ -429,7 +429,7 @@ class Settings {
result.writeln(' Connect to port: $socketPort');
result.writeln(' First line of input must be "$securityString"');
result.writeln(
' meter incoming data by time (for debug): $meterData');
' meter incoming data by time (for debug): $meterData');
result.writeln(
' ${localAddresses.length} available network interface(s):');
for (final s in localAddresses) {
Expand Down
3 changes: 2 additions & 1 deletion display_app/breezy/lib/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ class _SettingsScreenState extends State<SettingsScreen>
return true;
},
child: Scaffold(
appBar: AppBar(title: Text('Breezy Settings')),
appBar: AppBar(
title: Text('Breezy Settings')),
body: SingleChildScrollView(
padding: EdgeInsets.all(5),
child: Column(
Expand Down
3 changes: 2 additions & 1 deletion display_app/breezy/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: breezy
description: Breezy - Emergency Ventilator Display

version: 0.0.10
version: 0.1.0

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down Expand Up @@ -43,6 +43,7 @@ flutter:
uses-material-design: true
assets:
- assets/demo.log
- assets/breeze_icon_white_256x256.png

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down

0 comments on commit 320a6bc

Please sign in to comment.