StephenBlackWasAlreadyTaken / xDrip-Experimental

Experimental Branches for Collaboration on DexDrip
GNU General Public License v3.0
25 stars 62 forks source link

X drip viewer8 #291

Closed tzachi-dar closed 8 years ago

tzachi-dar commented 8 years ago

This is the xDripViewer rebased on the current master.

It also changes the labels for the watch.

AdrianLxM commented 8 years ago

Compiling this on my system does not include the wear-release. It isn't even created.

tzachi-dar commented 8 years ago

On my system, ./wear/build/outputs/apk/wear-release-unsigned.apk was created. Are you looking for another thing?

tzachi-dar commented 8 years ago

actually, this is an old file, looking at it more deeply.

AdrianLxM commented 8 years ago

It has to be signed... I think I can find a fix by propagating the configuration in the dependency to the wear app.

tzachi-dar commented 8 years ago

I believe that signing, can also be done later by the following steps:

follow: http://developer.android.com/tools/publishing/app-signing.html

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /usr/local/google/home/tzachi/Downloads/signed_apk_keystore_copy.jks ./app/build/outputs/apk/app-xDrip-release-unsigned.apk xDrip

jarsigner -verify -verbose -certs ./app/build/outputs/apk/app-xDrip-release-unsigned.apk

/usr/local/google/home/tzachi/AndroidSDK/android-sdk-linux/build-tools/22.0.1/zipalign -v 4 ./app/build/outputs/apk/app-xDrip-release-unsigned.apk ./app/build/outputs/apk/app-xDrip-release.apk

Or is it another type of signing?

AdrianLxM commented 8 years ago

Well, if you sign the wear-app later, you have to repack the app-release to include the wear.apk and resign it again. This is a lot of work. Better to find a solution where it is done automatically.

tzachi-dar commented 8 years ago

But to sign it in the process, I have to do something like: signingConfigs { release { storeFile file("myreleasekey.keystore") storePassword "password" keyAlias "MyReleaseKey" keyPassword "password" } }

and than I have to expose the passwords. But is this what you mean?

AdrianLxM commented 8 years ago

No, it should be a simple rewrite of the dependency including passing of the configuration parameter. I will update the build.gradle in a few minutes.

I will have to de-capitalize the names of the flavours for that to work.

tzachi-dar commented 8 years ago

OK, thanks.

AdrianLxM commented 8 years ago

https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/294 This should do it.

tzachi-dar commented 8 years ago

OK, thanks.

AdrianLxM commented 8 years ago

When compiled as "xDripViewer", the settings section "Data Sync" (where you usually upload things) is empty but the section is still there.

AdrianLxM commented 8 years ago

It would be great if this could also be automatically renamed to "XDripViewer settings": https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/blob/xDripViewer8/wear/src/main/res/xml/preferences.xml#L4

AdrianLxM commented 8 years ago

At the moment exports form xDrip and xDrip-Viewer go to the same directory and maybe even overwrite themselves (in case of settings-export). In would be nice if you could conditionally change this string (https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/blob/xDripViewer8/app/src/main/java/com/eveningoutpost/dexdrip/utils/FileUtils.java#L17) to "./xdripviewer".

AdrianLxM commented 8 years ago

The Android-Wear integration now works perfectly fine with the NS account you provided. Even when the hundreds of values come in after initialization: The arrow dances a bit and the "minutes ago" count down - but everything runs smoothly on the watch :+1:

Also when having installed both xDripViewer and xDrip on the same phone, you can simply toggle the watchfaces from xDrip to xDripViewer and back.

In the next couple of days I hope I can test this with data produced from the medtronic uploader thanks to @MosiGithub.

tzachi-dar commented 8 years ago

I'll try to fix the points that you have raised, most of them should not be that complicated.

As for testing with the medtronic uploader, I'm not that optemisitc. The current code is looking at fields that are only uploaded when xDrip is at xDripviewer upload mode. Will they have such fields?

Thanks Tzachi

AdrianLxM commented 8 years ago

Well, at least it should not crash (as people may have disabled xDripViewer upload mode)... so I can test that.

By the way: I've been running xDrip (flavour) compiled from this PR and it works as it is supposed to. No noticable difference to xDrip prior to that :+1: :)

tzachi-dar commented 8 years ago

Sure, you can test that there are no crashes. I guess that next steps are indeed to test it with other uploaders. I would start with the "classic nightscout uploader" first.

tzachi-dar commented 8 years ago

As for settings. The file name for the viewer will be: com.eveningoutpost.dexdrip.viewer_preferences.xml

So, should I change the directory, or is changing the filename alone enough?

AdrianLxM commented 8 years ago

It should be a different directory. Databas export would still look the same - and then possibly be imported to the wrong programme. Changing the directory makes xdrip or xdripviewer search in just their directory for imports.

tzachi-dar commented 8 years ago

ok, I'll fix that with a different directory.

tzachi-dar commented 8 years ago

Committed a fix for different file name and directory for xDrip and xDripViewer. Also changed settings on the watch.

tzachi-dar commented 8 years ago

as for the "Data Sync" not appearing in the xDripViewer. I can obviously remove it, but this will have a price in code. This will need a lot more if statements. So I thought that I'll change that on the viewer to be something like "No data sync" or maybe change that to "".

Thoughts?

AdrianLxM commented 8 years ago

If it is so much easier take "". I'd say. This will give us a double delimiter and doesn't look bad either.

tzachi-dar commented 8 years ago

OK, fixed the datasync issue.

tzachi-dar commented 8 years ago

Added support for xDripViewer even when xDrip itself is not in xDripViewer mode.

tzachi-dar commented 8 years ago

If anyone has more comments please let me know.

tzachi-dar commented 8 years ago

Closing this branch since it was merged in xDripViewer 8.