• Breaking News

    Monday, March 15, 2021

    Android Dev - Weekly Who's Hiring Thread - March 15, 2021

    Android Dev - Weekly Who's Hiring Thread - March 15, 2021


    Weekly Who's Hiring Thread - March 15, 2021

    Posted: 15 Mar 2021 07:00 AM PDT

    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]

    Kotlin Multiplatform — A panacea for mobile app development?

    Posted: 15 Mar 2021 02:48 AM PDT

    My first app (I am 16 and new to android dev so sorry if it's not that polished) I am waiting for it to be reviewed on google console right now. It's an app which has some little text tools it's called TEXT

    Posted: 14 Mar 2021 03:00 PM PDT

    compose-remember-preference - Jetpack Compose library for remembering State persistently

    Posted: 15 Mar 2021 06:00 AM PDT

    compose-remember-preference - Jetpack Compose library for remembering State persistently

    GitHub: https://github.com/burnoo/compose-remember-preference

    I've created Jetpack Compose library for remembering State persistently, based on DataStore preferences. Basically it's persistent version of remember { mutableStateOf(x) }.

    Library contains functions that returns MutableState, which supports data persistence. Here is simple example:

    @Composable fun OnboardingExample() { var isOnboardingCompleted by rememberBooleanPreference( keyName = "onboardingKey", // preference is stored using this key initialValue = null, // returned before preference is loaded defaultValue = false, // returned when preference is not set yet ) when (isOnboardingCompleted) { null -> Loader() false -> Onboarding(onCompleted = { isOnboardingCompleted = true }) true -> MainScreen() } } 

    Demo (source):

    https://reddit.com/link/m5k5v7/video/dvj2f4wrw6n61/player

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

    Fonibo App Suspended by Google (mistakenly)

    Posted: 14 Mar 2021 09:06 AM PDT

    Fonibo App Suspended by Google (mistakenly)

    Our Fonibo on-demand Grocery and Food Delivery app Suspended by Google because of one of our grocery merchants selling tobacco between 55.000+ products. We see many similar apps in our category selling tobacco products without any problem. We wrote more than 10+ emails to the Google Policy team, informed them that we removed tobacco products, but always received the same default answer. Our team helped too many people during Covid 19 for staying at home and buy anything that they want. As result, our startup lost more than 25.000+ users, our couriers lost their jobs. We removed the tobacco category of this merchant, what anything else we can do to recover.

    Suspended by Google

    • App name: com.fonibo.shop
    • Description of the app: On-demand anything delivery

    E-mail from Google Play Policy Team

    Competitors like Wolt and etc selling tobacco and e-cigarettes as well. Which is "restricted"

    Wolt selling restricted e-cigarettes at PlayStore without any problem

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

    Copying file on android 11

    Posted: 15 Mar 2021 07:30 AM PDT

    I am trying to copy a file from my app's own folder that I create using getExternalFilesDir() to a folder that I created using media store. Both folders created successfully, but when I try to copy the file I get "No such file or directory" even though the file is literary right there. Anyone knows why this is happening? I have looked all over the internet, but I can't find a solution.

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

    My works for Android Dev Challenge Jetpack Compose (So far)

    Posted: 15 Mar 2021 03:40 AM PDT

    I want to share the works I did so far for Android dev challenge jetpack compose. I just start learning Jetpack Compose when the challenge started, it's been a fun / challenge experience.

    Build a puppy adoption app! The app should contain an overview screen that displays a list of puppies, and a detail screen showing each puppy's details.

    I learned about layout, list, text and navigation.

    Here is the GitHub repository: https://github.com/vsay01/android-dev-challenge-compose-puppy-adoption

    Create a working, single screen countdown timer.

    I learned about state and animation.

    Here is the GitHub repository: https://github.com/vsay01/android-android-dev-challenge-compose-count-down-timer

    Be the fastest to implement a set of designs provided by us. The designs will be posted here when the challenge starts.

    I picked up the design for Americas-friendly, wetrade.

    I learned about the theming, layout, navigation and also the way that Jetpack Composes help speeds up the UI development. The development needs to accounted for both light and dark themes.

    Here is the GitHub repository: https://github.com/vsay01/android-dev-challenge-compose-wetrade

    (Note: When I have time, I'll work on other two designs)

    There are awesome designs for this challenge that other did, you can search twitter with #AndroidDevChallenge.

    Happy learning and let me know what you think.

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

    Is there a way of passing the NDEF message to a string?

    Posted: 15 Mar 2021 05:40 AM PDT

    Hey guys,so I have an NFC tag that stores a URL and I am building an android app that reads that tag and starts the app to the Main activity. After that I have a WebView that displays that website. My problem here is, each tag has a different url/path (lets say they are clothing items and each point to a product on the website). How do I get the NDEF message from the tag (the url) and pass it to that parameter of the webview? Thank your for your help, here I will leave my code.

    I have followed the android documentation on NFC both, basic and advanced, googled every page and searched everything on reddit, however I could not find any answer...

    This is my Main Activity, the one that opens as soon as it reads the tag:

    class MainActivity : AppCompatActivity() { private var adapter: NfcAdapter? = null 

    // Pending intent for NFC intent foreground dispatch. // Used to read all NDEF tags while the app is running in the foreground. private var nfcPendingIntent: PendingIntent? = null // Optional: filter NDEF tags this app receives through the pending intent. //private var nfcIntentFilters: Array<IntentFilter>? = null

    private val KEY_LOG_TEXT = "logText"

    override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main)

     } private fun getNDefMessages(intent: Intent): Array<NdefMessage> { 

    val rawMessage = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES) rawMessage?.let { return rawMessage.map { it as NdefMessage }.toTypedArray() } val empty = byteArrayOf() val record = NdefRecord(NdefRecord.TNF_UNKNOWN, empty, empty, empty) val msg = NdefMessage(arrayOf(record)) intent.putExtra("msg", msg) return arrayOf(msg) }

    fun retrieveNFCMessage(intent: Intent?): String { intent?.let{ 

    if(NfcAdapter.ACTION_NDEF_DISCOVERED == intent.action) { val nDefMessages = getNDefMessages(intent) nDefMessages[0].records?.let { it.forEach { it?.payload.let { it?.let { return String(it) } } } } } else { return "Touch NFC tag to read data" } } return "Touch NFC tag to read data" } }

    This is the webview activity:

    class Webview : AppCompatActivity() { private lateinit var webview: Webview1 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_webview) val myWebView: WebView = findViewById(R.id.webview) myWebView.webViewClient = object : WebViewClient () { override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { if (url != null) { view?.loadUrl(url) } return true } } myWebView.loadUrl("website.com") myWebView.settings.javaScriptEnabled=true myWebView.settings.allowContentAccess=true myWebView.settings.domStorageEnabled=true myWebView.settings.useWideViewPort=true } } 

    I want to pass the NDEF message to myWebVIew.loadUrl().

    Is there a way of doing so?

    Thank you for your help.

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

    Absolute file path in Android 11 (API 30). logcat -f logs

    Posted: 15 Mar 2021 05:16 AM PDT

    Hi there,

    I have logging feature in app. It writes logs to file and user can send it by email with attached file.

    To get logs into file I use runtime command, which writes logcat logs to file:

     File file = new File(path); String command = "logcat -f " + file.getAbsolutePath(); Process process = Runtime.getRuntime().exec(command); 

    Now when target API is 30 it stop working due to new limitations.

    Questions:

    1. Maybe there is another way to get this logs?
    2. How can I get such log file in Android 11?
    submitted by /u/nevtop
    [link] [comments]

    Compile less with SOLID

    Posted: 14 Mar 2021 11:24 AM PDT

    Is it common to save sensitive Cache data inside /data/data/com.app?

    Posted: 15 Mar 2021 03:00 AM PDT

    I am pentesting a crypto exchange app (I am a noob), and find tons of PII and session cookies in my /data/data/[com.app] directory. I am so confused to see so many sensitive data that I start to doubt if this is really a safe practice.

    Really appreciate if someone can explain this to me.

    To me, as long as the user doesn't root the device, everything should be fine?

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

    How to add display of QR code information using augmented reality

    Posted: 15 Mar 2021 01:12 AM PDT

    App publishing and null supprt from playstore

    Posted: 15 Mar 2021 12:22 AM PDT

    App publishing and null supprt from playstore

    Hi all, i´ve put my first app to review mid last week to deploy today by its still in review , no responses to email and chat button is disabled (although in working hours now).

    Is everyone experiencing similar delays and difficulties?

    Is there an alternative ?

    https://preview.redd.it/xnxbts2785n61.png?width=1048&format=png&auto=webp&s=70bf799c3348dbb3760d9f4e61aef6f86918ced5

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

    Android Image Loading *without* a Library - Common Interview Question

    Posted: 14 Mar 2021 08:08 PM PDT

    How could I implement all these theme configurations?

    Posted: 14 Mar 2021 05:10 PM PDT

    So I'm working on a new project, and the designer has specified a couple different items to be themeable across the app:

    • The accent color (users are given 5 options)
    • Text size (for accessibility/preference, again 5 options)

    These two mixed with the necessity to implement light and dark modes, and I'm a bit stuck on the implementation. If I create a theme in styles.xml, we know I can't change any of those values at runtime after user selection, all I can do is setTheme.

    I'm looking for a solution that doesn't require creating separate themes for each of the 50 potential configurations a user could choose (especially when the difference across themes is only two fields). That seems like a funky code solution.

    Really seems like there is an obvious option I'm not seeing... or should I just get to typing out these themes?

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

    why passing list.size * 2 +1 to this code makes the adapter circular?

    Posted: 14 Mar 2021 02:18 PM PDT

    I am currently trying to make an both direction auto scrollable recycler view. after trying some failed attempts , i searched the internet and came across this code:

    ```

    class InfiniteLoopAdapter(private val itemList: List<String>) : RecyclerView.Adapter<ImageViewHolder>() {

    override fun onAttachedToRecyclerView(recyclerView: RecyclerView) { super.onAttachedToRecyclerView(recyclerView) val linearLayoutManager = recyclerView.layoutManager as LinearLayoutManager recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { super.onScrolled(recyclerView, dx, dy) val firstItemVisible = linearLayoutManager.findFirstVisibleItemPosition() if (firstItemVisible != 1 && firstItemVisible % itemList.size == 1) { linearLayoutManager.scrollToPosition(1) } val firstCompletelyItemVisible = linearLayoutManager.findFirstCompletelyVisibleItemPosition() if (firstCompletelyItemVisible == 0) { linearLayoutManager.scrollToPositionWithOffset(itemList.size, 0) } } }) } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ImageViewHolder { val view = LayoutInflater.from(parent.context).inflate(R.layout.pager_view, parent, false) return ImageViewHolder(view) } override fun getItemCount() = itemList.size * 2 + 1 override fun onBindViewHolder(holder: ImageViewHolder, position: Int) { val realPosition = position % itemList.size holder.bind(itemList[realPosition]) } 

    } ``` Sorry this may seem to be a code review, but i really hope someone could answer me ans I wish to learn more about this approach. This is simply a recycler view of strings which is somehow scrolling back to 0th position after the last 4th position. I know we can make a recyclerview infinite by returning Int.MAX from getItemCount() but this won't be making it infinite. it uses some tricks via linear layout manager that i don't understand.

    1. How is it working?
    2. I found a bug in this. it won't really become scrollable in the opposite(ltr) direction until user swipes a slight right to left.so why is it doing like that and how can i fix this? I am guessing the scroll listener is not active until user scrolls manually , so a programmic call to scrollTo(0,0) might work?
    3. I wish to make this autoscroll too. and its going to be a part of viewholder of a nested recyclerview with many other different view types, so where to go from here?
    submitted by /u/appdevtools
    [link] [comments]

    How to prevent element/view from moving when adding constraints?

    Posted: 14 Mar 2021 08:53 PM PDT

    Hi, I'm new to android dev. When I go to add constraints to a view like a button, it moves the element in the direction of the constraint. How do I prevent this/turn it off?

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

    How does internal test build update distribution work

    Posted: 14 Mar 2021 04:48 PM PDT

    Specifically with updates. When I push a new update it seems like I have to Uninstaller and reinstall for it to update to the new version. Is this just how it works or am I doing something wrong? Thanks

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

    NEED SOME HELP HERE!

    Posted: 14 Mar 2021 07:50 PM PDT

    NEED SOME HELP HERE!

    Hi, folks!

    I'm trying to use the bluetooth adapter but is running an error. When I try to see the code, it's missing the references as you can see. What can I do to fix it? Thank you!

    everything is red, man

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

    Android app as a web browser for mobile website

    Posted: 14 Mar 2021 02:42 PM PDT

    Are there any apps that are just a web browser that points to a mobile website? Wondering how viable it is to basically just make your app with javascript. I'm sure there's some limitations in terms of device access and it wouldn't be available without network connectivity but I'm curious.

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

    No comments:

    Post a Comment