Mark M. | has entered the room |
Mark M. | turned on guest access |
Feb 16 | 7:50 PM |
Scott W. | has entered the room |
Scott W. |
Hey Mark
|
Mark M. |
hello, Scott!
|
Mark M. |
how can I help you today?
|
Scott W. |
I'd like to continue our discussion about hosting an Android library on Maven Central
|
Mark M. |
OK
|
Scott W. |
It looks like Maven Central has an open source policy
|
Scott W. |
My company doesn't want to open source our library.
|
Mark M. |
OK
|
Scott W. |
I want to make sure I understand what that would mean though. Does it mean I would I have to upload un-obfuscated code?
|
Mark M. |
usually, the reference to "open source" is more of a licensing thing
|
Scott W. |
So I wouldn't have to upload my actual java files or anything?
|
Feb 16 | 7:55 PM |
Scott W. |
I guess I'm curious how the AAR wraps all of this stuff up.
|
Mark M. |
I'm still trying to confirm that open source policy
|
Scott W. |
ok
|
Mark M. |
the AAR is a compiled library and does not contain source code
|
Mark M. |
a common pattern with open source libraries is to have a separate artifact that is the source code
|
Mark M. |
that's is what allows you to view the source of the library in Android Studio, for example
|
Mark M. |
but, that's not a technical requirement to be able to use the library
|
Mark M. |
ah, but I do see where Maven Central requires sources
|
Mark M. |
at least for "packaging other than pom", and I'm not completely certain what that entails
|
Mark M. |
there is little question that Maven Central is dominated by open source -- I guess I had not realized that was a requirement
|
Scott W. |
no worries
|
Scott W. |
I'm reading a document our company hosts saying we "adopted this Open Source Software Policy"
|
Feb 16 | 8:00 PM |
Scott W. |
Can you link me the page you were on detailing the requirements for maven central?
|
Mark M. |
here is what appears to be their main page for "producers" of artifacts: https://central.sonatype.org/pages/producers.html
|
Mark M. |
roughly speaking, there are two ways to get into the Central Repository
|
Mark M. |
one is to publish as open source and use their "Open Source Software Repository Hosting" service
|
Mark M. |
the other is to be using some other repository manager software and sync with theirs -- that's the "Large Organization/Forges" section
|
Mark M. |
"Forges" refers to hosted project management services, but of the ones that they list, the only active one that I recognize is Atlassian
|
Mark M. |
(there, presumably, they are referring to Bitbucket, an Atlassian service)
|
Mark M. |
and I don't know whether there is a closed source option via Bitbucket for publishing artifacts, either directly or via sync to the Central Repository
|
Mark M. |
again, I'd like to point out: this isn't really my area
|
Mark M. |
I've done a bit of this sort of thing, but mostly using homebrew solutions, and I'm far from expert at publishing artifacts
|
Mark M. |
so, I'm happy to help, but... imagine a grain of salt about 12" on a side, and take that grain of salt with my recommendations :-)
|
Scott W. |
I understand. You know a lot more about all parts of this than me, so it still helps to talk through.
|
Feb 16 | 8:05 PM |
Mark M. |
but, from reading that page (and https://central.sonatype.org/pages/requirements...), I do agree that you are likely to find it a struggle, at best, to publish closed source artifacts this way
|
Scott W. |
what about through jfrog, jcenter and all that stuff that is dying soon?
|
Scott W. |
The example we looked at last week was OpenTok. I don't recall seeing their source code.
|
Scott W. | |
Mark M. |
they might be using hosted JFrog Artifactory or something
|
Mark M. |
I know that commercial software exists for hosting artifact repositories, and Artifactory is one (Sonatype, the folks behind Central Repository, have their Nexus product)
|
Mark M. |
I have not looked into these solutions
|
Mark M. |
OpenTok is backed by Vonage IIRC, and so they have somewhat more horsepower behind them than, say, I do
|
Feb 16 | 8:10 PM |
Scott W. |
The Amazon S3 bucket is starting to look a lot better.
|
Scott W. |
sonatype nexus looks way too complicated.
|
Mark M. |
S3 is what I use for my CWAC libraries
|
Mark M. |
and, my current consulting client is using it for internal artifact distribution
|
Scott W. |
ok I've got another question.
|
Mark M. |
the sorts of posts that we discussed last time are likely focused on public-access S3 buckets -- AFAIK, there is no publishing-side differences for authenticated buckets
|
Scott W. |
right. I saw in those articles the library user was still having to add authentication to the s3 bucket in build.gradle
|
Scott W. |
so we would need to hand the authentication out to our customers, and only they would be able to access the library.
|
Scott W. |
is that correct?
|
Mark M. |
correct
|
Mark M. |
obviously, you have issues of the password being leaked or otherwise passed around, so it's not exactly Fort Knox
|
Scott W. |
yeah
|
Mark M. |
but it should greatly constrain access to your artifacts
|
Scott W. |
well we don't really care if people get the artifacts.
|
Feb 16 | 8:15 PM |
Scott W. |
we just don't want to publish the source code. That's my understanding.
|
Mark M. |
in that case, skipping the authentication to read the S3 bucket makes things a bit easier for you and the customers
|
Scott W. |
true
|
Mark M. |
and there is no requirement for you to publish source code, other than the XML of the POM file itself
|
Mark M. |
the AAR is compiled code
|
Scott W. |
that sounds good
|
Scott W. |
I'll try to set that up with a sample library this week and present a proof of concept.
|
Mark M. |
sounds like a plan!
|
Scott W. |
Does in matter if my library is signed with a specific key?
|
Mark M. |
you don't have to sign an AAR
|
Mark M. |
for publishing through Maven Central, you do, but that's a policy, not a technical requirement
|
Mark M. |
so, for example, my CWAC libraries' AARs are not signed
|
Scott W. |
./gradlew assemble —- will this sign the AAR?
|
Mark M. |
not normally, though there may be a recipe to configure Gradle to do that
|
Scott W. |
would the fact that it's signed prevent anyone from using it?
|
Mark M. |
APKs get signed when assembled, which is why you need to teach Gradle about signing keys to get assembleRelease to work
|
Feb 16 | 8:20 PM |
Mark M. |
no
|
Mark M. |
all signing does, for APKs or AARs or JARs, is allow people to confirm that Thing 1 was signed by the same party as Thing 2
|
Mark M. |
AARs and JARs might go the next step and use real certificates -- like you do for SSL -- that have some ties to real-world identities
|
Mark M. |
but they are not a DRM solution
|
Mark M. |
signing also makes the APKs/AARs/JARs a bit tamper-resistant, though I'm not sure if AARs/JARs have signatures validated that way
|
Scott W. |
What is Thing 1 and Thing 2 in the example of me publishing an APK through Google Play Store?
|
Mark M. |
Thing 1 is version 1 of your app
|
Mark M. |
Thing 2 is version 127 of your app, or a pirated copy of the app, or a hacked version of the app being distributed on "the dark Web"
|
Scott W. |
got it
|
Scott W. |
ok running out of time. I have another question!
|
Mark M. |
go ahead!
|
Scott W. |
I started work on a feature today to allow 12 people in our video chat app.
|
Scott W. |
so with 12 video feeds, we want to display 4 at a time in a 2x2 grid
|
Scott W. |
and there can be 3 pages of grids that the user can navigate to by tapping an arrow or something.
|
Scott W. |
Google really wants me to use RecyclerView for some reason.
|
Feb 16 | 8:25 PM |
Scott W. |
I'm looking into using GridView
|
Mark M. |
GridView is rather old and is designed for a vertically scrolling grid
|
Scott W. |
and when the user taps the arrow, I'll just swap out the feeds in the GridView cells.
|
Scott W. |
ah
|
Mark M. |
if what you want is a 2 x 2 grid, use ConstraintLayout
|
Scott W. |
GridLayout then?
|
Scott W. |
hmm
|
Mark M. |
(or TableLayout or RelativeLayout or maybe GridLayout if you can find somebody who actually used it)
|
Scott W. |
I would have a ConstraintLayout inside of a ConstraintLayout then.
|
Mark M. |
if you already have a ConstraintLayout, you might not need a second one to set up a 2 x 2 grid, then
|
Mark M. |
just add the cells and set up appropriate constraints
|
Scott W. |
There are some issues with multiple SurfaceViews as direct children of my parent ConstraintLayout
|
Scott W. |
punching holes in things and covering up other UI elements.
|
Mark M. |
that's a SurfaceView issue -- I doubt that adding another container layer will help
|
Scott W. |
Keeping all of them in the same ViewGroup under the ConstraintLayout has fixed the issues for me.
|
Mark M. |
the point of SurfaceView is to punch a hole in the normal UI processing and hand it over to something low-level for high-speed rendering, like video playback
|
Mark M. |
OK
|
Mark M. |
but, then, having a ConstraintLayout in a ConstraintLayout is not a problem
|
Mark M. |
or, at least, no more of a problem than is having a GridLayout or TableLayout or RelativeLayout in a ConstraintLayout
|
Scott W. |
ok I figured it might create some issues, but I'll give that a try.
|
Scott W. |
yeah
|
Mark M. |
the "no nested ConstraintLayout" guideline is because usually you don't need it
|
Feb 16 | 8:30 PM |
Scott W. |
I get some weird behavior on older devices with nested ViewGroups
|
Mark M. |
if you need it for reasons (e.g., you're applying a background to the nested one), then it's fine
|
Scott W. |
aight well thanks again for the help!
|
Mark M. |
you're more likely to have better results with ConstraintLayout nesting, then, as that's a library
|
Mark M. |
older devices don't get bug fixes for framework layout types
|
Scott W. |
oh that's a good tip
|
Scott W. |
ok I'll sign off. Have a good night!
|
Mark M. |
you too!
|
Scott W. | has left the room |
Mark M. | turned off guest access |