Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 15 | 4:00 PM |
Jonathan | has entered the room |
Jonathan |
Hi
|
Mark M. |
hello, Jonathan!
|
Jonathan |
I have enjoyed reading your book.
|
Mark M. |
how can I help you today?
|
Mark M. |
thanks!
|
Jonathan |
I'm trying to compile audio recording software.
|
Jonathan |
In android studio.
|
Jonathan |
Newest version.
|
Jonathan |
Not sure how to configure.
|
Jonathan |
Got errors.
|
Mark M. |
not sure how to configure... what?
|
Jonathan |
Android studio? Gradle? Not sure.
|
Mark M. |
compile errors? or are you crashing when you run the app?
|
Jonathan |
Mostly before. But sometimes it runs and immediately crashes.
|
Jun 15 | 4:05 PM |
Mark M. |
um, OK
|
Mark M. |
when it runs and crashes, what does the Java stack trace in LogCat say?
|
Jonathan |
I can go check.
|
Jonathan |
It is installed on this computer, so I need to switch windows.
|
Jonathan |
I went to omnibus, media, audiorecording.
|
Jonathan |
Gradle is running.
|
Mark M. |
are you referring to this project? https://github.com/commonsguy/cw-omnibus/tree/m...
|
Jonathan |
Exactly. From the book.
|
Jonathan |
Asks me to update gradle from 2.3.3. to 3.3 should I?
|
Mark M. |
either way should be fine
|
Jun 15 | 4:10 PM |
Jonathan |
I accepted the update.
|
Jonathan |
Gradle is still building
|
Mark M. |
your development machine needs a faster CPU, more RAM, an SSD, or perhaps all three
|
Mark M. |
this is a *very* small project
|
Jonathan |
Maybe.
|
Jonathan |
Indexing.
|
Jonathan |
I'm now running the application on my Nexus 5 2 GB 23 M.
|
Jonathan |
Gradle build running.
|
Jonathan |
Emulator starting up.
|
Mark M. |
emulator?
|
Mark M. |
I would not expect this sample to work on an emulator
|
Jun 15 | 4:15 PM |
Jonathan |
Oh.
|
Jonathan |
Why?
|
Mark M. |
as far as I know, an emulator does not emulate a microphone
|
Mark M. |
now, I just ran the sample on an Android 6.0 emulator
|
Jonathan |
I plugged in my Nexus 5 (physical device to USB). It is running marshmellow.
|
Mark M. |
it did not crash
|
Mark M. |
but I would not expect to get any output, as at least on my machine, the "enable microphone" option is disabled in the emulator controls
|
Jonathan |
It didn't crash on mine this time.
|
Jonathan |
Yet, I *can* run audio recording on the emulator.
|
Mark M. |
earlier in this chat, you indicated that you were getting compile errors sometimes, and runtime crashes sometimes
|
Mark M. |
I cannot help you without the details
|
Jonathan |
How do I get this code to run on my phone? (I'll get back to the compile errors after.)
|
Jun 15 | 4:20 PM |
Mark M. |
just two statements ago, you said "It didn't crash on mine this time"
|
Mark M. |
in context, "mine" is your phone, from what I can tell
|
Jonathan |
No, speaking about the emulator.
|
Mark M. |
then try running it on the phone, and provide me with the details of what is going wrong
|
Mark M. |
I cannot help you without a Java stack trace or specific compile errors
|
Jonathan |
It just does an on-off with a click flashing the screen (on the emulator).
|
Mark M. |
that is all the UI is supposed to do -- it's a ToggleButton
|
Jonathan |
Please remind me how I get it to run on the phone that is attached.
|
Mark M. |
the same way that you get it to run on an emulator: click the green triangle "run" button in the Android Studio toolbar
|
Mark M. |
if your device is set up for USB debugging, Android Studio should give you the option of running on it
|
Jonathan |
I had to stop the application first.
|
Mark M. |
if Android Studio does not pop up a dialog asking where you want to run the app, then there is an issue in the run configuration for this project, which we can fix
|
Jonathan |
View paste
|
Mark M. |
OK, Android Studio and your phone are not getting along for some reason
|
Jonathan |
Yup.
|
Mark M. |
when you ran the project, did Android Studio display a dialog, asking where you wanted to run the app?
|
Mark M. |
(with a list of emulators, plus your device)
|
Jonathan |
Yes
|
Mark M. |
and your device was in the list, and you chose it?
|
Jonathan |
Yes
|
Mark M. |
if you look on the device, in the home screen launcher, is the app there?
|
Jun 15 | 4:25 PM |
Mark M. |
it is called "Audio Recording" and has the CommonsWare "molecule" icon
|
Jonathan |
yes
|
Mark M. |
try running it from the launcher
|
Jonathan |
It just started up on a my phone.
|
Jonathan |
The UX was translated into the language of my phone. A good thing.
|
Jonathan |
What is it supposed to do?
|
Jonathan |
The AudioRecorder application?
|
Mark M. |
um, that is covered in the book chapter
|
Mark M. |
if you tap the ToggleButton, it will begin recording
|
Jonathan |
I thought it was supposed to record audio and play it back.
|
Mark M. |
if you tap it a second time, it will stop recording
|
Mark M. |
no, it does not play it back
|
Mark M. |
it just records it
|
Jonathan |
And puts it where?
|
Mark M. |
the recording is saved on external storage, in the Download/ directory, as recording.3gp
|
Mark M. |
though I do not have the MediaScannerConnection code in there to have it be indexed
|
Mark M. |
so it will only show up using something like adb shell
|
Jonathan |
I'll check.
|
Jonathan |
Yup. It works. Nice.
|
Jonathan |
So, next question. I'm trying to compile code -- not only yours and it doesn't work. I'll find an example.
|
Jun 15 | 4:30 PM |
Jonathan |
View paste
|
Jonathan |
What does that mean?
|
Mark M. |
I do not know
|
Mark M. | |
Mark M. |
try that (Select "File"->"Invalidate Caches/Restart...")
|
Jonathan |
For Android-AudioRecorder. It says "Change configuration settings?" Edit Continue anyway.
|
Jonathan |
Configuration is still incorrect.
|
Jonathan |
Do you want to edit it again?
|
Mark M. |
sorry, but I do not know what you are referring to
|
Jun 15 | 4:35 PM |
Mark M. |
I just ran File > Invalidate Caches/Restart on Android Studio 2.3
|
Jonathan |
I downloaded another audio recorder from github. Name of project is "Android-AudioRecorder" https://github.com/Uncodin/Android-AudioRecorder. Wondering how do I correct the configuration?
|
Jonathan |
What am I expected to do when I "edit configuration?"
|
Mark M. |
usually, in Android Studio, "configuration" refers to the "run configurations"
|
Mark M. |
you can edit them via Run > Edit Configurations
|
Mark M. |
but since I do not know what is wrong with your run configuration, I cannot tell you what to change
|
Jonathan |
I see general. Module. Deploy. Launch. Target.
|
Jonathan |
Don't think it is wrong. Just don't know how to fill in the form.
|
Jonathan |
It looks like it was a pre-android studio application, so it doesn't know the gradle parameters.
|
Mark M. |
I have not imported an old Eclipse project in a while, so I do not know what it sets up by default
|
Jonathan |
Pre-eclipse.
|
Mark M. |
I recommend you compare and contrast two projects, this one and one created directly in Android Studio
|
Mark M. |
um, unless it is from 2007 or something, there was no "pre-Eclipse" era in Android development, that I recall
|
Jonathan |
I'll try to find a compile error that I had earlier on another project.
|
Jun 15 | 4:40 PM |
Jonathan |
Ok. I opened sayit. Another open source project.
|
Jonathan |
View paste
|
Mark M. |
that project is set up to refer to a keystore.properties file from its Gradle build scripts
|
Mark M. |
and that file is missing
|
Jonathan |
View paste
|
Mark M. |
you would have to ask the project maintainers what to do
|
Jonathan |
They appear to be cryptographic keys. I think.
|
Mark M. |
it might configure those keys
|
Jonathan |
I'm looking for the file.
|
Jonathan |
View paste
(5 more lines)
|
Jun 15 | 4:45 PM |
Jonathan |
View paste
|
Mark M. |
there is supposed to be a keystore.properties file in the project root
|
Jonathan |
It seems to be creating the file, so why is it a problem?
|
Mark M. |
no, it is not creating the file
|
Mark M. |
it is creating the Groovy equivalent of a java.io.File object
|
Mark M. |
and trying to read from the file using a FileInputStream
|
Mark M. |
I demonstrate this sort of properties-reading code in one of the chapters on Gradle
|
Jonathan |
I can check there.
|
Mark M. |
so, when it tries to open the file, and the file is not there, you get the Gradle sync error
|
Jonathan |
So, if I read that chapter. Does that tell me how to create this file?
|
Mark M. |
no
|
Mark M. |
as I wrote, you would need to contact the project maintainers and ask them what is supposed to be in it
|
Jonathan |
Got it.
|
Mark M. |
the file itself is just a properties file, with key-value pairs
|
Mark M. |
but I have no way of knowing what keys and values are required
|
Jonathan |
That's what I thought.
|
Mark M. |
you might be able to reverse-engineer it from the Gradle script
|
Mark M. |
but, that's well outside the scope of what I can help with in these chats
|
Jonathan |
I'm moving on to trying other code I had difficulty with. Here is an error message from "longman-to-anki" project.
|
Jonathan |
Failed to maintain projects LRU cache for dir /Users/singingtorah-shtiebel_org/Library/Caches/AndroidStudio2.3/resource_folder_cache
|
Jonathan |
What is that?
|
Jun 15 | 4:50 PM |
Mark M. |
we discussed that previously
|
Mark M. | |
Jonathan |
Trying it.
|
Jonathan |
Restarting. I have a macbook air. 11" 1.3 Ghz. 8GB Ram 1600. 128 GB SSD. intel core 5. MacBook Air (11-inch, Mid 2013). What configuration do I need?
|
Mark M. |
1.3GHz is a bit slow
|
Mark M. |
8GB RAM should be fine, but that depends on what else you have open, of course
|
Jun 15 | 4:55 PM |
Jonathan |
More general question. I also seem to have asked before, but I didn't understand the answer. What chapter of your book covers how to set up the configuration, particularly for pre-android studio found open-source code?
|
Mark M. |
I do not cover that
|
Mark M. |
I talk about run configurations in a few spots, specifically around testing
|
Jonathan |
Thank you for helping me today. I feel that I learned from it. Have a wonderful evening.
|
Jonathan |
:-)
|
Mark M. |
note that the transcript will be published on https://commonsware.com/office-hours/ shortly after the chat ends
|
Jun 15 | 5:00 PM |
Mark M. |
that is a wrap for today's chat
|
Mark M. |
the next chat is Tuesday at 4pm US Eastern
|
Mark M. |
have a pleasant day!
|
Jonathan | has left the room |
Mark M. | turned off guest access |