Office Hours Transcript: 2021-07-03

Scott joined

hello, Scott!

 

how can I help you today?

Hello!

 

Working on organizing my question right now

 

ok I have an issue with READ_PHONE_STATE in my app. The issue is specific to the version of Android running the app.

 

I’m not to my knowledge requesting this feature in the manifest, but I am checking the phone state through telephony manager.

"requesting this feature" – what feature are you referring to?

sorry, I meant permission

 

READ_PHONE_STATE\

The crash happens on Android 5.1

 

Android 6 introduced runtime permissions

 

But I’m never asking the user for this permission.

 

telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE) This is the line triggering the crash

 

my merged manifest lists the following permissions: CAMERA, INTERNET, RECORD_AUDIO, MODIFY_AUDIO_SETTINGS, WRITE_EXTERNAL_STORAGE, READ_CONTACTS, VIBRATE, ACCESS_NETWORK_STATE, …c2dm.permission.RECEIVE, FOREGROUND_SERVICE

is the crash a SecurityException telling you that you need READ_PHONE_STATE?

sanketnaik314 joined

and, if not, what is the crash?

 

(BTW, hello, sanketnaik314 – I will be with you shortly!)

SecurityException is correct

 
Neither user 10201 nor current process has android.permission.READ_PHONE_STATE.

OK, so add that permission to your manifest – it is listed as dangerous, so most likely you need to request it at runtime on Android 6.0+ devices

 

but it feels like you know all that already

yes

 

I’d like to understand why it isn’t crashing on any devices above 5.1

 

Users can’t avoid this check if they are using the app.

presumably, listen() no longer requires that permission, then, as of Android 6.0

 

in that case, you might be able to get away with just putting it the manifest, skipping the runtime permission check

yeah

 

would it be possible to determine if the permission is required by stepping into the function with the debugger?

possibly, but not necessarily – it is likely to be checked in a core OS process

Hello, i just wanted to ask , how to go about learning jetpack libraries, other than the ones which are taught in the book. Also should i learn jetpack compose ? It seems like it is going to replace xml

I’ll investigate this a bit and check in after time with sanketnaik314

 

@sanketnaik314: In terms of learning about other libraries (Jetpack or otherwise), you can try the library’s documentation, plus your typical search engine searches to find up-to-date blog posts, Stack Overflow questions, etc.

are there going to be updates on jetpack book ?

 

in the future ?

if you mean Elements of Android Jetpack, I have two updates planned for later this year, including one coming up in just a few weeks

ok that is great to know, i have purchased the subscription

 

that will be very helpful, i hope it covers more libraries. Thank you

in terms of Jetpack Compose, at some point, you likely will want to learn how to use it – however, it has not yet shipped a stable release, so there is no rush

I expect that adoption of Compose will resemble adoption of Kotlin: slow at first, accelerating with time

by 2023, my guess is that you will want to at least have a plan about learning Compose, if you have not learned the basics by that point

ok sir

I’ll jump back in

 

I plan to follow this.

 

I have a second question about firebase cloud messaging

yeah, anything that can point to an AOSP commit is promising

 

@sanketnaik314: let me take Scott’s second question, and I will be back with you shortly

I’m trying to update my dependency, and some key components have been deprecated and removed from the library.

sure sir

I’ve found current documentation that tells me to use FirebaseMessagingService, but I can’t resolve this class in my project with the latest dependency

sorry, I have not worked with FCM recently, so I am not up to speed with current versions and APIs

Changed to open an Activity directly when a notification is tapped instead of passing it through FirebaseMessagingService. This change is to comply with Android 12 notification trampoline restrictions.

 

Do you know anything about this change in Android 12 they are talking about?

yeah I’ll read up on all of this myself.

 

I really need an FCM support call or something

AFAICT, this only gets blocked when you raise your targetSdkVersion to 31, so you have some time

 

though, if the latest FCM changed already, you will need to adapt to those changes sooner

yeah that’s the problem. I’ll need to push back updating FCM until I can figure this out.

let me take another question from sanketnaik314, and I’ll return to you in a bit

ok

@sanketnaik314: back to you! do you have another question?

i have a broader general question, how to plan your application in the beginning, so that maintaining it is easy.
Also i wanted to know, what back end would you suggest to use for simple and complex android applications

 

planning as in, do you make prototype using figma or adobe xd first, plan the database with uml etc

how to plan your application in the beginning, so that maintaining it is easy

I have no way to answer that, as the details would vary massively by type of app, and I am not expert at all possibilities. My focus is on helping developers learn how to work with the Android SDK and key libraries.

planning as in, do you make prototype using figma or adobe xd first, plan the database with uml etc

Personally, I have never used any of those. But, that is just me.

Clean Architecture: A Craftsman’s Guide to Software Structure and Design is a great book that I found helpful for thinking about the design of a project

what back end would you suggest to use for simple and complex android applications

Personally, I create my own Web services running on Linux. I cannot provide recommendations for alternatives.

ok, i will check it out

 

you have your own servers ?

effectively, yes

people recommend AWS

and I know people who use it – again, I am not expert in a range of solutions and am not in position to supply recommendations

ok sir

 

but thank you for the book recommendation

sure thing

let me take another question from Scott, and I will be back to you in a bit

 

Scott: over to you! do you have another question?

Do you have any experience publishing to the Amazon app store?

nope – I have researched in on occasion, but their policy of resigning your APKs always turned me off

yeah this is exactly why I’m asking

 

Company wants Windows machines running our Android app if possible

the details of exactly what options there will be for Windows 11 are still murky

 

not to mention that Windows 11 itself might not ship until early next year, if I understand correctly

 

my hope is that there will be alternatives to the Amazon AppStore for Android, such as a direct option through Microsoft

that would be nice

hopefully, we will get more clarity in a few months

well, not a question, but I have a little story. I decided to leave my job. The company offered to pay me more to keep me on. I stuck with leaving. Then they offered to pay me a lot more with 2 months off.

 

You’ve mentioned how hard it is to find developers, so I thought you’d like to know it’s felt by someone else.

 

They looked for a replacement for a month and then decided to make me the bigger offer.

yeah, often it is cheaper to keep somebody with existing experience in their product and tech than it is to try to spin up somebody else

 

and that assumes that they can find a "somebody else"

 

so, um, congratulations on your raise! 😁

yep. It was also an opportunity for me to gain more control over my team and get some professional development set up in the company

 

thank you!

Congratulations Scott

thank you too :)

Sir, do you have any recommendation in how to rank your apps higher on google playstore ? app store optimization etc

sanketnaik314: no, sorry

:: I’m heading out to enjoy the rest of my Saturday. Bye Bye ::

Scott: have a pleasant day!

ok , thank you

Scott left

i am leaving as well, thank you for your suggestions

sorry I could not be of greater help!

you have already shared lot of knowledge with us

 

i have searched and searched and searched the internet untill i came across the updated version released by you

 

due to the rapid changes in the past few years in android development, it has been very hard to follow up

yes, I know what you mean

so its really helpful to get a place to get all the resources at one place

 

i will be uploading your updated courses on hackr.io, so that it will help others as well

 

also there are many questions about courses on android and kotlin on reddit and quora, so it will be nice for them as well

thanks!

Bye, have a great day

you too!

sanketnaik314 left