• Breaking News

    Wednesday, May 25, 2022

    Android Dev - Android Studio Chipmunk | 2021.2.1 Patch 1 now available

    Android Dev - Android Studio Chipmunk | 2021.2.1 Patch 1 now available


    Android Studio Chipmunk | 2021.2.1 Patch 1 now available

    Posted: 25 May 2022 10:58 AM PDT

    Cannot use Kotlin contracts with Android

    Posted: 25 May 2022 01:35 PM PDT

    Cannot use Kotlin contracts with Android

    Hi.

    I'm trying to use Kotlin contracts on my Android project, but I can't seem to figure it out.

    I the playground I can it works but if I do this in my code:

     @OptIn(ExperimentalContracts::class) private fun Any?.isNull(): Boolean { contract { returns(false) implies (this@isNull != null) } return this == null } fun test() { val name: String? = null if (name.isNull()) { println("name is null") } else { println("name is ${name.length} characters long") } } 

    In the name.length I always get the error Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String

    I've played around in app build gradle to pass the opt-in flag to the compiler (see image) but I'm always getting the error: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?

    Any idea of how to implement this?

    Some of the options I've tried.

    https://preview.redd.it/scq1y23dno191.png?width=3332&format=png&auto=webp&s=185e4d05f9c5e82a14b1ae7219dac29940fd27f1

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

    I have build a android app called Just Listen and it is open source

    Posted: 24 May 2022 10:30 PM PDT

    The app is a media player that is using public APIs for fetching details about the songs/playlists.

    Features

    • Search songs & playlists on the Audius infrastructure
    • Listen to songs & audiobooks in the background for free
    • Create your private playlists
    • Adds songs to favorite
    • No data leaves your phone, other than the calls to get information from Audius APIs

    As a note, it is terrible written, but it works, soo I decided to publish it because I worked quite a lot on it.

    Technologies :

    • Kotlin Multiplatform Mobile
    • SQLDelight
    • Ktor
    • Jetpack Compose

    Here is the repository: https://github.com/RLD-JL/Just-Listen

    Any contributors are way more than welcome.

    submitted by /u/rld-just-listen
    [link] [comments]

    want to start developing android apps need help

    Posted: 25 May 2022 01:39 PM PDT

    So I have experience in python but just wanted to do some mobile development to expand I guess. But I don't actually know of any of the common terms and what's out there. Can someone please help me understand what options are there and what you would recommend I do because kinda lost lol

    submitted by /u/-VOA-
    [link] [comments]

    Using the Bing Maps SDK with Jetpack Compose, but how?

    Posted: 25 May 2022 07:37 AM PDT

    Hi team,

    yes, I'm new to Android, Kotlin, Jetpack Compose, that's why this question might be a little bit hideous.

    Since the Microsoft Surface Duo emulator and the Windows Subsystem for Android do not support the Google Play Services, I must use another Map provider.

    I checked out Bing Maps SDK - since it has a more simpler token structure and pricing for hobbyist projects than e.g. MapBox.

    The problem is that the official tutorial from Microsoft only supports Java, XML and Activities. No Kotlin, nor Jetpack Compose in sight. I created a feature issue in the related GitHub repository and a post in the Surface Duo TechNet community.

    It's hard for me to write a bridge between the "old" way in which the Bing map component lives and the new one Jetpack compose.

    My googling was without any helpful tip or success, that's why I'm now asking you.

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

    Any non-EU android devs made it to EU ,what is your story?

    Posted: 25 May 2022 02:27 PM PDT

    Can a photo recovery app from a play store steals the scanned data to the server side?

    Posted: 25 May 2022 01:20 PM PDT

    I recently used one of the free photo recovery apps available on the play store in my old android s3 phone. It was successfully able to find the multiple copies of images but with low quality. My question is, if it is possible that the images I clicked recover on are also saved on the server where app developer can access it? In the privacy policies I didn't find much info but it claim to perform read only operation in the device. Response will be highly appreciated.

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

    Google play instant - NFC permissions?

    Posted: 25 May 2022 12:44 PM PDT

    I read that instant apps do not access NFC while app clips from the other world do. Is there a workaround to have NFC available? Or maybe a plan to enable that in the future?

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

    Bank verification deposit

    Posted: 25 May 2022 12:43 PM PDT

    Hi everyone,

    Yesterday I created my first developer account on Google Play Console.

    I followed the steps to add a new payment method and entered my bank's account information. It's one of the most widely used banks in Canada.

    Google is supposed to make a deposit in my account and I'll enter the number in the dashboard to validate it.

    It's been almost 24 hours and nothing yet. I know that they say it could take 2-3 business days, but I'm just wondering if this is common.

    If anyone here had to do this validation recently, how long did it take for you to see the deposit in your account?

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

    Handling user authentication

    Posted: 24 May 2022 11:57 PM PDT

    This might seem like a basic topic; however, i have a few questions about handling user authentication. I'd say i'm a currently a Junior level Android Developer, and have been developing applications with user authentication with the help of Firebase. I want to expand this so that i don't re-implement the same logic if i ever want to make an IOS version or even a Website for my application. Till now, I've established that i need to create a server and deal with all the backend code there, exposing whatever functionality i need using some sort of API. i've got the basics of (CRUD) operations using REST down. However i feel lost when trying to implement server-side authentication. I'm having trouble differentiating between authentication and authorization and the general flow.

    If you have some reliable and beginner friendly documentation, please feel free to share them (I'm using Nodejs with the express framework as my server-side code)

    any help would be greatly appreciated. Thank you!!

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

    how can i retrieve single object from database ?

    Posted: 25 May 2022 11:38 AM PDT

    i've an app that sends an api request to send back bitmap, im able to insert the bitmap into database using room and im also able to retrieve all the data and view it in recyclerview

    but what am i asking for is how can i retrieve that single image to view it in single imageview

    what Query should i use? and how to observe it in a fragment ?

    Model class

    u/Parcelize
    u/Entity(tableName = "history_table")

    data class History (

    u/ColumnInfo(name = "text") val text: String,
    u/ColumnInfo(name = "type") val type: String,
    u/ColumnInfo(name = "image") val image: Bitmap

    ): Parcelable {

    u/PrimaryKey(autoGenerate = true)
    var id: Int = 0

    }

    Dao

    u/Dao
    interface HistoryDao {

    u/Insert(onConflict = OnConflictStrategy.IGNORE)
    suspend fun addHistory(history: History)

    u/Query("SELECT * FROM history_table ORDER BY id ASC")
    fun readAllData(): LiveData<List<History>>

    }

    Repository

    class HistoryRepository(private val historyDao: HistoryDao) {

    val readAllData: LiveData<List<History>> = historyDao.readAllData()

    suspend fun addHistory(history: History) {
    historyDao.addHistory(history)
    }
    }

    View Model

    u/InternalCoroutinesApi
    class DatabaseViewModel(application: Application): AndroidViewModel(application) {

    val readAllData: LiveData<List<History>>
    private val repository: HistoryRepository

    init {
    val historyDao = HistoryDatabase.getDatabase(application).historyDao()
    repository = HistoryRepository(historyDao)
    readAllData= repository.readAllData
    }

    fun addHistory(history: History) {
    viewModelScope.launch(Dispatchers.IO) {
    repository.addHistory(history)
    }
    }

    Fragment

    class SuccessFragment : Fragment() {

    private lateinit var binding: FragmentSuccessBinding

    override fun onCreateView(
    inflater: LayoutInflater, container: ViewGroup?,
    savedInstanceState: Bundle?
    ): View? {
    // Inflate the layout for this fragment
    binding= FragmentSuccessBinding.inflate(inflater, container, false)

    //observer here

    return binding.root
    }

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

    Google Developer account removed can't upload apps issue

    Posted: 25 May 2022 11:04 AM PDT

    My Google Developer account removed can't upload apps. But my admob account is still enable. After 4 years of developer account disabled i got an email that my admob account is going to disable if i am not reserving ads.

    Warning message is - AdMob account inactive Your AdMob account has been inactive for over 5 months. Accounts that haven't served ads for 6 months will be automatically deactivated.

    Can anyone have an idea to save my admob account. Can't upload new apps because of disabled google developer account. My account had 6 apps all are got better user count. all gone one night four years ago. Please give some ideas to save my admob account.

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

    Do you know someone who made lot of money by making android apps?

    Posted: 24 May 2022 10:10 PM PDT

    There are many good android developers who make good app. But I don't think most of their apps generate any revenue on play store. If someone has managed to pull this off how did they do it?

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

    RecyclerView with different item layout

    Posted: 25 May 2022 09:55 AM PDT

    i mean lets say you call an api and u fetch json data and then u call anotehr api and the data are different so u need a different layout/view i mean the design of the list items right inside the recyclerview different textviews and the layout etc. how can u do that?

    ExampleAdapter.java

    package com.example.recyclerview_cards; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; public class ExampleAdapter extends RecyclerView.Adapter<ExampleAdapter.ExampleViewHolder> { private ArrayList<ExampleItem> mExampleList; public static class ExampleViewHolder extends RecyclerView.ViewHolder { public TextView mTextView1; public TextView mTextView2; public ExampleViewHolder(View itemView) { super(itemView); mTextView1 = itemView.findViewById(R.id.textView01); mTextView2 = itemView.findViewById(R.id.textView02); } } public ExampleAdapter(ArrayList<ExampleItem> exampleList) { mExampleList = exampleList; } @Override public ExampleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.example_item, parent, false); ExampleViewHolder evh = new ExampleViewHolder(v); return evh; } @Override public void onBindViewHolder(ExampleViewHolder holder, int position) { ExampleItem currentItem = mExampleList.get(position); holder.mTextView1.setText(currentItem.getText1()); holder.mTextView2.setText(currentItem.getText2()); } @Override public int getItemCount() { return mExampleList.size(); } } >>>>>>>>>>>>>>AnotherFile<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ExampleItem.java 

    package com.example.recyclerview_cards;

    public class ExampleItem { private int mImageResource; private String mText1; private String mText2; public ExampleItem( String text1, String text2) { mText1 = text1; mText2 = text2; } public String getText1() { return mText1; } public String getText2() { return mText2; } } 

    AnotherFile<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< package com.example.recyclerview_cards;

    import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { private RecyclerView mRecyclerView; private RecyclerView.Adapter mAdapter;//Bridge between data and image/ arrayList and RecyclerView private RecyclerView.LayoutManager mLayoutManager;//allign single items in our list @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ArrayList<ExampleItem> exampleList = new ArrayList<>(); for(int i=0;i<50;i++){ String tmp="Text: "+i; String tmp2="Text: "+(i+1); exampleList.add(new ExampleItem(tmp, tmp2)); } mRecyclerView = findViewById(R.id.recyclerView); mRecyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(this); mAdapter = new ExampleAdapter(exampleList); mRecyclerView.setLayoutManager(mLayoutManager); mRecyclerView.setAdapter(mAdapter); } } 

    submitted by /u/No-Sleep-9475
    [link] [comments]

    What are the use cases of Data Binding and when is it better to use compared to View Binding?

    Posted: 24 May 2022 09:11 PM PDT

    I am new to Android programming. My usage of View Binding is pretty much just replacing FindViewById. Is it worth it to explore Data Binding if I just want to use View Binding in my projects ?

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

    About 5G NSA

    Posted: 25 May 2022 04:03 AM PDT

    Hi everyone,

    I'm trying to retrieve the ARFCN (Frequency Channel Number) that a device in a 5G network is currently using. The thing is that the 5G all the operators in my city offer is of the NSA type, thus meaning that the phone will always be registered to a 4G LTE network as a primary cell and will use a 5G NR cell as a secondary one.

    To get the mentioned ARFCN one will normally use the PhoneStateListener.onCellInfoChanged(List<CellInfo> cellInfo)) method and check from the list which CellInfo is that one the device is registered on, get the CellIdentity attached to it and then get the ARFCN. The problem is that, aside from being only registerd to a CellInfoLTE (4G) there's no trace of any CellInfoNR (5G), registered or not. Weird thing is I can get the 5G signal intensity through PhoneStateListener.onSignalStrengthsChanged(SignalStrength signalStrength)).

    Any lead, piece of advice or hope is welcomed :) Thanks for reading.

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

    How to read the "Private DNS provider hostname" programmatically in Android?

    Posted: 25 May 2022 07:06 AM PDT

    I wanted to know what is the way to read the "Private DNS provider hostname" under Settings Network, Advanced , Private DNS ?

    This stackoverflow post is for writing to the Private DNS setting but I was just looking for reading the settings.

    https://stackoverflow.com/questions/71225614/how-to-open-private-dns-settings-in-android-programmatically

    An app by the name of CleanBrowsing available on the Google play store is able to write and change the settings but cannot just figure out how it is done.

    Any inputs will be highly appreciated.

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

    Is Android Java dead?

    Posted: 25 May 2022 12:28 AM PDT

    Hello folks,

    Reading many post here, many tutorial on the Net or sample code, a big part is written in kotlin. I still develop in Java. So did I am an old dev using a dead (or almost) technology and language? Did I need to switch rapidly to kotlin?

    Thanks for your time for reading me and your answers.

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

    anyone experienced with modifying android studio source code?

    Posted: 25 May 2022 02:57 AM PDT

    I can do some basic coding in c# but I am not familiar with the android studio source code or anything like that. I'd like to modify a few things I am missing but need.

    The only way to properly achieve that is by modifying android studio and compiling the source.

    Feel free to message me if you think you're able to help me out.

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

    making api calls through localhost

    Posted: 25 May 2022 01:25 AM PDT

    I've been using NGROK because I don't understand how to properly connect my locally ran Api(.Net core 6 Web API) with my android app . I've even followed tutorials, looked at stackoverflow etc, but nothing.When I use other WIFIs NGROK is blocked,is there an alternative for NGROK or something?

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

    Question about View Binding

    Posted: 24 May 2022 01:52 PM PDT

    I've begun cleaning up some old Java code, and in a few fragments and activities I've included view binding in order to get rid of a bunch of findViewByIds.

    Having done that, however, when I run "Code / Inspect..." on the module, the dozens of xml layout files that are being inflated via view binding are now noted in Lint as "Unused elements." An example:

    fragment_settings_display_standby.xml ("Unused resource") ...which is being used by FragmentSettingsDisplayStandbyBinding binding = FragmentSettingsDisplayStandbyBinding.inflate(...)

    How do you keep these resources from showing as unused?

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

    No comments:

    Post a Comment