• Breaking News

    Monday, November 8, 2021

    Android Dev - Weekly Who's Hiring Thread - November 08, 2021

    Android Dev - Weekly Who's Hiring Thread - November 08, 2021


    Weekly Who's Hiring Thread - November 08, 2021

    Posted: 08 Nov 2021 06:00 AM PST

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

    submitted by /u/AutoModerator
    [link] [comments]

    startActivityForResult Deprecated Problem

    Posted: 08 Nov 2021 05:35 AM PST

    Hello everyone!

    I have a very small problem but I can't solve it. As you can see, the only function of the program is to take a photo when the button is clicked and display this photo via ImageView. But this method has been deprecated. I do not know what to do.

    Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button b = (Button)findViewById(R.id.camerabtn);
    Button select_image_button = findViewById(R.id.button);
    ImageView img_view = findViewById(R.id.imageView2);
    b.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
    Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
    }
    });
    }

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == CAMERA_PIC_REQUEST) {
    Bitmap image = (Bitmap) data.getExtras().get("data");
    ImageView imageview = (ImageView) findViewById(R.id.imageView2); //sets imageview as the bitmap
    imageview.setImageBitmap(image);
    }

    }

    submitted by /u/ulmonan
    [link] [comments]

    Can't have more than one GoogleMap in a RecyclerView

    Posted: 08 Nov 2021 08:05 AM PST

    I'm trying to make an "Instagram like" app, where there is a RecyclerView on the MainActivity that contains PostItems (with text and other data) that contains a GoogleMap (SupportMapFragment).

    My issue is that the first map shows up but the others don't. Is there something I'm missing ?

    class PostAdapter( private var postList : MutableList<Post>, private val mActivity : AppCompatActivity, private val primaryNavigationFragment: Fragment ) : RecyclerView.Adapter<PostAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val binding = PostItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) return ViewHolder(binding, mActivity) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { holder.bind(postList[position]) } override fun getItemCount(): Int = postList.size class ViewHolder( private val binding : PostItemBinding, private val mActivity: AppCompatActivity ) : RecyclerView.ViewHolder(binding.root), OnMapReadyCallback { fun bind( postItem: Post ) { with(binding) { textViewRouteName.text = postItem.name createMapFragment(binding, postItem) } } override fun onMapReady(googleMap: GoogleMap) { val mMap = googleMap ... } private fun createMapFragment(binding: PostItemBinding, postItem: Post) { val mapFragment = mActivity.supportFragmentManager .findFragmentById(R.id.postItemMapFragment) as SupportMapFragment mapFragment.getMapAsync(this) } } 

    post_item.xml

    ... <androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/postItemMapFragment" xmlns:tools="http://schemas.android.com/tools" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="300dp"/> ... 

    App screenshot: https://i.stack.imgur.com/lfZIS.png

    (repost of https://stackoverflow.com/posts/69869317/)

    submitted by /u/djessy5001
    [link] [comments]

    Keyboard navigation in Jetpack Compose

    Posted: 08 Nov 2021 04:02 AM PST

    Android usually supports navigation with the tab and enter key as described here.

    However, when using Jetpack compose this option seems unavailable. Is this true and if yes I wonder what would be the simplest method to navigate a Jetpack Compose Kotlin App using my keyboard?

    maybe use the custom navigation as described here ? or better implement a whole new navigation method as described here?

    Thank you for any help!

    submitted by /u/Plastic_Speaker
    [link] [comments]

    I'm working on a demo app for using BLE + MVVM, with a novel approach for using bound services from view models. Would appreciate feedback and review!

    Posted: 07 Nov 2021 05:25 PM PST

    Does anyone has experience on how to setup Facebook Ads to promote Android app?

    Posted: 08 Nov 2021 08:01 AM PST

    Does anyone has experience on how to setup Facebook Ads to promote Android app?

    All the while, we are using Google Ads to promote Android app, due to ease to use with 0 modification on Android client code.

    However, recently, we would like to expand to use Facebook Ads to promote Android app.

    I wish to keep track, how many people install our app, after clicking on Facebook Ads.

    I had followed the instruction https://developers.facebook.com/docs/app-events/getting-started-app-events-android

    But, it is quite confusing, as when I try to verify the modification is done correctly, here's the outcome

    https://preview.redd.it/exi6exxn8ey71.png?width=1474&format=png&auto=webp&s=0b16622d0bdca00dfceaa0e9c12835b203edeff8

    1. I don't know why the error message related to iOS is shown. Our app is Android app, and not iOS app. lol ?!

    I tested in Emulator and has enabled everything

    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> 

    <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="true"/> <meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="true"/> <meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="true"/>

    But, I see no app install event being sent to facebook.

    I check any logging message printed related to facebook.

    We are only getting warning message

    2021-09-19 18:33:50.524 7948-8025/com.yocto.wenote W/GraphRequest: Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change. 2021-09-19 18:33:50.525 7948-8034/com.yocto.wenote W/GraphRequest: Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change. 2021-09-19 18:33:50.532 7948-8038/com.yocto.wenote W/GraphRequest: Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change. 2021-09-19 18:33:50.533 7948-8040/com.yocto.wenote W/com.facebook.internal.NativeProtocol: Apps that target Android API 30+ (Android 11+) cannot call Facebook native apps unless the package visibility needs are declared. Please follow https://developers.facebook.com/docs/android/troubleshooting/#faq_267321845055988 to make the declaration. 2021-09-19 18:33:50.833 7948-8038/com.yocto.wenote W/GraphRequest: Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change. 

    As, we do not plan to use any Facebook related feature, except of measuring the number of installs due to Facebook Ads, I guess that is fine.

    Anyone know why my Facebook Event Manager unable to record an install event?

    Thanks.

    submitted by /u/yccheok
    [link] [comments]

    Best way to retrieve daily app usage time. [Kotlin]

    Posted: 08 Nov 2021 07:49 AM PST

    Hey guys! i am currently working on an app where the user can set a daily limit usage time for the other installed apps. in order to accomplish that, i need to retrieve the daily app usage time. Whenever that usageTime is greater than the one set, the app must be blocked.

    Specifically i need the total time in foreground.

    In the following link there's a working implementation but i find it very inefficient. https://stackoverflow.com/questions/61677505/how-to-count-app-usage-time-while-app-is-on-foreground

    Do you know if there are other alternatives?

    i already tried with this (https://developer.android.com/reference/android/app/usage/UsageStats#getTotalTimeInForeground())) and with queryAndAgreggateUsageStats (https://medium.com/@quiro91/show-app-usage-with-usagestatsmanager-d47294537dab) but for some reason it doesn't work as intended.

    submitted by /u/josefeliu
    [link] [comments]

    What emulator setups do you use?

    Posted: 08 Nov 2021 02:24 AM PST

    Hello I'm using pixel 2 1080x1920 API 21 emulator setup for testing. I want to include new setups for broader testing purposes. Which setups do you use and recommend?

    submitted by /u/unholy182000
    [link] [comments]

    No code platform for drug reminder.

    Posted: 08 Nov 2021 05:49 AM PST

    Hello. I'm a healthcare professional planning to make a pill reminder app with educational faq page for my clinic. I hired a developer on fiverr and i wasted 2 weeks and my budget only for him to deliver the faq page with nonfunctional reminder feature which is the whole point of the app. I will do it myself, i have no coding background but i could learn some no coding platform. My question is, what's the best platform to build this app? A platform that provides a template for something like a pill reminder would be perfect. Thank you very much in advanced.

    TLDR: Got screwed on fiverr, will build it myself on a platform, please advise.

    submitted by /u/dottorona
    [link] [comments]

    Have you ever used algorithms in Android development?

    Posted: 07 Nov 2021 11:56 AM PST

    I have a few years of experience in multiple companies and I never even saw any algorithm in production code let alone writting them myself. However many companies want you to know how to write them, sometimes they require you to have like 100+ solved tasks on leetcode. For me this will take at least 6-12 months and it looks like such a waste of time to spend so many hours on something no one will ever use. I would rather contribute all those hours into opens source projects or helping people but FAANG-like companies do not care about your open source contributions if you can't reverse a tree in 10 minutes.

    So I'm stuck and I don't know if I should fight through this for a year, get hired and then forget everything in a week until next interview. Or should I just wait for the times when companies would hire middle and senior developers without barely useful leetcode knowledge?

    submitted by /u/otatopx
    [link] [comments]

    Hey Android Developers, In this video I introduced Fork, a git client that improves your experience using git by visualizing all of the git functionalities.

    Posted: 07 Nov 2021 11:32 PM PST

    android jetpack

    Posted: 08 Nov 2021 02:27 AM PST

    what's new?

    submitted by /u/harrylefit
    [link] [comments]

    Detect microphone activity without record audio

    Posted: 07 Nov 2021 02:49 PM PST

    Detect microphone activity without record audio

    Is there any library that will allow me to detect input activity in the device?I'm trying to display in the screen if the microphone is detecting sounds, simple as that.

    Right now I have a solution using default Android MediaRecorder, here it is simplified:

    https://preview.redd.it/hrejo6g259y71.png?width=767&format=png&auto=webp&s=05c2b3b1323068592b7299ac3242b631f8ebf51e

    Basically, every 250ms I can see the maxAmplitude which I can use to determine if the microphone is detecting sounds.

    Now... the problem with this is that this MediaRecorder RECORDS hehe, and that's not very efficient, all I need is just detect activity in the microphone, that's it because I am planning to use this feature in a screen that is meant to be opened for about an hour or two.

    Is there any better way to do this?

    Also MediaRecorder default constructor is deprecated, the other one requires API 31 which surprises me how high the requirement is.

    submitted by /u/Caballep
    [link] [comments]

    Is it realistic to write an WebServer with a small database in less than 3 days?

    Posted: 07 Nov 2021 02:17 PM PST

    If you never did something with servers before?

    submitted by /u/FlexSlutsRocknRoll
    [link] [comments]

    Android autofill framework in chrome

    Posted: 07 Nov 2021 09:24 AM PST

    Hi,

    How can I use autofill framework in chrome. I can run it in other apps, webviews, but I cant in web e.g. in chrome.

    Thanks for any advices.

    If you have any question feel free to ask!

    submitted by /u/raaamb0
    [link] [comments]

    How to export and import Android emulator snapshot

    Posted: 07 Nov 2021 08:19 AM PST

    I didn't find any documentation on how to use these 2 guys: - adb emu avd snapshot pull - adb emu avd snapshot push

    I am able to export an existing AVD snapshot with $ adb emu avd snapshot pull baseline /User/user1/baseline WARNING: unrecognized file format /User/user1/baseline OK

    It seems that I am also able to import the AVD snapshot with $ adb emu avd snapshot push baseline /Users/user1/baseline WARNING: unrecognized file format /Users/user1/baseline OK

    Listing the snapshots with adb emu avd snapshot list shows nothing.

    What is the correct way to export and import AVD snapshots?

    submitted by /u/mrvincenzos
    [link] [comments]

    No comments:

    Post a Comment