Office Hours — Today, September 19

Tuesday, September 17

Sep 19
7:20 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:25 PM
Ed
has entered the room
Mark M.
hello, Ed
how can I help you today?
Ed
Hi Mark
I've got a very old Android app I need to upgrade
it will only build compile with Android 2.3.3
after that compiling fails...
Mark M.
I'm not certain what you mean -- are you referring to the compileSdkVersion?
Ed
can I ask you a few questions about that topic and your advice?
Mark M.
sure!
7:30 PM
Ed
Android Studio 2.3.3 will build it
anything older fails
not a difficult app --- would like to not re-write it
Mark M.
why would you want an older Android Studio?
Android Studio 2.x is already rather old -- the current shipping version of Android Studio is 3.5
Ed
I don't but I wanted to compile and build it. :D
that is correct
anything else failed to build it
Mark M.
you wrote "anything older fails" -- so, use the latest Android Studio
or did you mean "anything newer fails"?
Ed
sorry... yes... anything newer
I need to eat dinner... lol
Mark M.
ah, now we're getting somewhere
(though "somewhere" unfortunately will not involve dinner)
Ed
View paste (2 more lines)
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.android.support:design:23.0.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'io.reactivex:rxandroid:0.25.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.dagger:dagger:2.0'
    compile 'com.google.dagger:dagger-compiler:2.0'
    compile 'org.glassfish:javax.annotation:10.0-b28'
    provided 'com.github.frankiesardo:icepick-processor:2.3.6'
    compile 'com.github.frankiesardo:icepick:2.3.6'
...
so I have it building in 3.5 with an error of....
Mark M.
*waits with breathless anticipation*
Ed
lol
sorry
7:35 PM
Mark M.
*gasps*
*now waits with ordinary anticipation, along with breathing*
Ed
failed to resolve library
I converted everything over to API 28
Mark M.
I
do you mean targetSdkVersion 28?
I'm not quite certain of the scope of "everything"
Ed
yes... sorry
Mark M.
OK
Ed
wish I could screen share
View paste
Could not find library.aar (com.viewpagerindicator:library:2.4.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/viewpagerindicator/library/2.4.1/library-2.4.1.aar
you know that library? I've never heard of it
Mark M.
yes, that's Jake Wharton's library of tabs and stuff for ViewPager
hasn't been updated in a very long time
as Jake has moved on to bigger and better things :-)
Ed
:-)
I'm thinking I should move all of this to JetPack
after I get it to compile on API 28
Mark M.
that may be prudent, depending on your plans for the app
can you post your top-level build.gradle file? the one in the project root directory?
Ed
yes sir... the 'app' file ?
7:40 PM
Ed
or higher
7:40 PM
Mark M.
higher
Ed
View paste (4 more lines)
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
...
Mark M.
in the allprojects closure, you have a repositories closure
it has google() and jcenter()
add mavenCentral()
and see if that clears up that specific problem
you'll wind up with:
View paste (5 more lines)
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
...
Ed
done
still got error...
View paste (30 more lines)
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find library.aar (com.viewpagerindicator:library:2.4.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/viewpagerindicator/library/2.4.1/library-2.4.1.aar
	at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:27)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:335)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:290)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.lambda$resolveArtifact$15(ErrorHandlingModuleComponentRepository.java:185)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.tryResolveAndMaybeBlacklist(ErrorHandlingModuleComponentRepository.java:24
...
Let me trace that down....
Mark M.
it does not seem to have checked the new location, and it's also not listing Google's repos as a place to look
Ed
found it
View paste
// https://mvnrepository.com/artifact/com.viewpagerindicator/library
compile group: 'com.viewpagerindicator', name: 'library', version: '2.4.1'
Mark M.
right, and you'll see there "Central" under "Repositories"
that's why I suggested trying mavenCentral()
oh, wait
that's not an AAR, it's an apklib
that's a long-since obsolete library packaging mechanism
Ed
ahhh. thank you
I wouldn't have known that
7:45 PM
Mark M.
an apklib is reminiscent of an AAR, but not quite the same
Ed
This is just a 'busy indicator spinner' right?
Mark M.
no, you're using it for a ViewPager
tabs, dots, or other things to show which page the user is on out of the set of pages
Ed
like a recycler view?
ahh... I know where it is
Mark M.
ViewPager was the classic horizontal swipe page-at-a-time thing
Ed
circle dots on bottom... left to right viewing
Mark M.
that sounds like it
so, your options are:
Ed
yes
Mark M.
1. nuke those dots and nuke the reference to the library
2. upgrade to a newer indicator library
3. convert the apklib into a Gradle module and still use ViewPagerIndicator
I'd recommend #1 or 32
sorry: I'd recommend #1 or #2
but #3 should be possible if needed
Ed
1 works
thanks!
I have one more question... if possible
Mark M.
in case you change your mind on #2, here's a whole category of ViewPager add-ons, including lots of indicators: https://android-arsenal.com/tag/111?sort=created
and there's nobody else here, so you can ask all the questions you want!
if somebody else shows up, I'll time-slice between you
Ed
sounds good
Jet Pack --- would you build a shipping app with it?
Mark M.
well, Jetpack makes up a whole lot of stuff
Ed
I understand it is suppose to be AppCompat... up to API 28
it does
and I don't feel all of JetPack is fully baked
Mark M.
AppCompat is one piece of the Jetpack brand
7:50 PM
Ed
this app... is super small....
Mark M.
well, I don't have opinions on all the stuff -- Auto for example
Ed
it needs to graph photos and take a pic... and send it to a printer... that's it
Mark M.
so, you won't necessarily need much from Jetpack anyway
Ed
GRAB.... wow... sorry
it needs JSON info
and the legacy nicely uses RxJava to talk to the printer server...
Mark M.
Jetpack doesn't really do much with the networking stuff -- OkHttp or Retrofit are the typical solutions for that
though that's a *really* old RxJava
Ed
it uses Retrofit if you noticed
Mark M.
yes, I see that now
anyway, back to Jetpack: most of the components that I have worked with are in decent shape, at least the release versions (compared to alpha/beta/rc)
Ed
for image crop and rotation I was hoping to use CameraX but it's half baked in Alpha
Mark M.
yes, that's pretty new
and I think Google may be discovering what I discovered when writing two camera libraries: writing camera libraries sucks
Ed
it does
Mark M.
fotoapparat and CameraKit-Android are not Googly, but they have been around for a bit and work
Ed
I just finished working with the iOS print app that does this same thing... in Objective C. :(
Mark M.
my condolences
7:55 PM
Ed
the next iOS app will be in Swift
and I would like to convert this to Kotlin
easier on the brain.... to bounce between those two... but I've been doing java since the late 90s
I did C++ for 3 years... and couldn't run away from it quick enough. lol
Mark M.
so, how else can I help?
Ed
Kotlin or Java for this based on the legacy.... ?
Mark M.
well, that's more a question of what you're going to do with the app going forward
Ed
I'm pretty solid with Kotlin... I've done Groovy and Swift
Mark M.
if your objective is simply to get one more version out, it's not worth doing much
Ed
it will be the flag ship app moving forward
I work for a printer company
Mark M.
in that case, I'd progressively move it over to Kotlin
ah
Java/Kotlin interoperability is pretty solid, so you don't have to convert everything over at once
8:00 PM
Ed
Mark M.
cool!
Ed
I will not bore you with all of the printer details... but this talks to an Android TV touch screen device
Mark M.
Android TV... touchscreen?
that's unusual
Ed
I could send you a demo if you tell me where to send it
that box is old... we have a version 3 to ship soon
Mark M.
there have been a few people in this chat who have used that hardware, or something very similar
didn't know it ran Android TV, thoguh
er, though
Ed
X8 PiPo
Android 4.4.4 is that UI screen
Mark M.
I think of it as "the wedge"
Ed
using a chRoot install of Ubuntu
that is my server for wifi
that talks to the printers via USB
runs CUPS
I do REST posts of the images
it handles the print part
it's a lot of fun
but I trying to update the wireless base as well as the mobile apps that go with it
8:05 PM
Ed
why "the wedge" ? I don't get the reference....
Mark M.
the device is wedge-shaped
at least, in the photos
Ed
lol
it is
here is our newer print server... for doing passport ID photos...
video shows the new screen and UI
camera is a wifi camera
two guys built that and coded it... two very smart guys... I might add
I used to work at Shutterfly on their manufacturing software... this is way cooler
Mark M.
I've worked with a lot of hardware over the years, but I haven't worked directly with a printer since the dot-matrix days
Ed
these printers are crazy.... compared to a dot matrix or laser
sublimation photo printer... plastic ribbon with 4 panels
Mark M.
I've heard of that tech
Ed
3 process color and a clear panel for glossy / matte
we actually make the ribbon and paper for this printer at my plant
DNP makes about 80% of the ribbons used in all printers of this type
thermal ribbons as well.. we supply Zebra with their black thermal ribbon for example
8:10 PM
Ed
lots of fun.... and way better than a bank job
thanks for your time this evening!
Mark M.
you're welcome!
Ed
what type of Android phone do you have ?
Mark M.
I have about 50
Ed
you win
:-)
do you have a Pixel ?
Mark M.
yes, one of each generation
Ed
nice
I have an original in the QA lab at work
it's the only thing I can run 10
Mark M.
I usually buy the least-expensive option of each year's Google hardware
Ed
I really like the light/dark theme on 10
and iOS 13 shipped with it today... which I've already installed
Mark M.
it'll be interesting how many apps adopt dark mode support for Android, though
Ed
sigh... that's what is such a PITA with Android
that and the push/pull of files out of the VM of a device
8:15 PM
Ed
with iOS I can actually mount the simulated phone... just like a drive and work with that
Mark M.
I don't work with the emulator much
Ed
I love Android Studio though.... great IDE
Xcode still can't even do a decent Find... or format code
ugh
Mark M.
I haven't done much iOS, but I have heard the same complaint from others
Ed
I had to add a plugin... to format code
but Apple spoils me on screen sizes...
the have a unit of measure... for 1x, 2x or 3x where the x is pixel density
super easy to translate
my mind still explodes when I deal with Android screen sizes and fragments. :-)
Mark M.
as I've long said, Android's freedom is a double-edged sword
Ed
security in 10.... has less freedom
fwiw
I can't change wifi state
Mark M.
yes
Ed
so we had a version that would connect to the wifi print server and log you in... fails in 10
silently
Mark M.
I haven't used the new "suggest an AP to the user" API yet
Ed
and http calls are a pita no in Android... after 26 I think
they want everything to be https
Mark M.
you can enable cleartext traffic with a snippet of XML
8:20 PM
Mark M.
but, yes, HTTPS would be nice
scenarios like yours make that difficult
Ed
just a permission in the manifest
?
Mark M.
android:usesCleartextTraffic="true"
Ed
cool
thanks
Mark M.
or, android:networkSecurityConfig="@xml/whatever"
Ed
thanks for sharing your time... always enjoy chatting with you
Mark M.
happy to help!
Ed
'Professor'. :-)
thanks for the coupon with the typo on the web url this week
Mark M.
sure!
Ed
if you reply to that I can send you a video of the new WPS Pro print server... it's very cool
if you want to see it
Mark M.
thanks, but right now, I'm kinda swamped
Ed
we are trying to move away from the X8 to a Raspberry Pi option
I bet
you've got books to write! lol
cheers
Mark M.
that too
Ed
have a great evening
Mark M.
you too!
Ed
has left the room
8:30 PM
Mark M.
turned off guest access

Tuesday, September 17

 

Office Hours

People in this transcript

  • Ed
  • Mark Murphy