• Breaking News

    Monday, May 9, 2022

    Android Dev - Weekly discussion, code review, and feedback thread - May 09, 2022

    Android Dev - Weekly discussion, code review, and feedback thread - May 09, 2022


    Weekly discussion, code review, and feedback thread - May 09, 2022

    Posted: 09 May 2022 05:00 AM PDT

    This weekly thread is for the following purposes but is not limited to.

    1. Simple questions that don't warrant their own thread.
    2. Code reviews.
    3. Share and seek feedback on personal projects (closed source), articles, videos, etc. Rule 3 (promoting your apps without source code) and rule no 6 (self-promotion) are not applied to this thread.

    Please check sidebar before posting for the wiki, our Discord, and Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Large code snippets don't read well on Reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click here for old questions thread and here for discussion thread.

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

    Weekly Who's Hiring Thread - May 09, 2022

    Posted: 09 May 2022 06: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]

    Shakespeare (Star Trek?) easter egg in Build.VERSION_CODES.S_V2

    Posted: 09 May 2022 01:59 AM PDT

    Bouncy: Physics-based animation for NestedScrollView and RecyclerView

    Posted: 09 May 2022 02:24 AM PDT

    Bouncy: Physics-based animation for NestedScrollView and RecyclerView

    NestedScrollView and RecyclerView with physics based overscroll effect

    Achieved by overriding the default EdgeEffect

    GitHub: https://github.com/valkriaine/Bouncy

    BouncyRecyclerView

    BouncyNestedScrollView

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

    android studio ethernet ip

    Posted: 09 May 2022 07:47 AM PDT

    hi i'm still new to android studio and i'm tasked to work with a dev board the helper a64 and use the ethernet port on board i've banged hy head for days now to get the TCP SERVER working and still not there yet it's kinda working ....... kind of

    i want to get the ip adress from the device to display it on the app but since its using ethernet its difficult to do so .

    i managed to show what connection is used with the

    import android.net.ConnectivityManager; import android.net.NetworkInfo; ------------- private void checkNetworkConnection() { // BEGIN_INCLUDE(connect) ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeInfo = connMgr.getActiveNetworkInfo(); if (activeInfo != null && activeInfo.isConnected()) { boolean wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI; boolean mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE; boolean ethconnected = activeInfo.getType() == ConnectivityManager.TYPE_ETHERNET; if(wifiConnected) { Toast.makeText(this, "WIFI", Toast.LENGTH_SHORT).show(); } else if (mobileConnected){ Toast.makeText(this, "MOBILE", Toast.LENGTH_SHORT).show(); }else if(ethconnected){ Toast.makeText(this, "ETHERNET", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(this, "not connected", Toast.LENGTH_SHORT).show(); } 

    but i don't know where to go next i have on my files a android.net.ethernetmanager but it has a @@hide comment which i read somewhere that it is hidden class i tried following a bunch of people on how to unhide it but no luck

    all i want is to make a TCP server and read&EDIT the ip settings not wifi but ethernet

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

    What are the challenges in the Cross-Platform App Development Proces

    Posted: 09 May 2022 03:24 AM PDT

    Anyone else think TarsosDSP needs a BSD/MIT alternative?

    Posted: 09 May 2022 07:01 AM PDT

    Anyone else think TarsosDSP needs a BSD/MIT alternative?

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

    Why is an in used function still shown in usage.txt of proguard output?

    Posted: 09 May 2022 04:13 AM PDT

    I have the following code

    class MainActivity : AppCompatActivity() { private val obfuscatedClass = MyObfuscatedClass() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) obfuscatedClass.usedFunc() } } class MyObfuscatedClass { fun usedFunc() {} fun unusedFunc() {} } 

    With a normal proguard, I generate the usage.txt file, showing the unusedFunc()there

    com.example.myobfuscateretracetest.MyObfuscatedClass: public final void unusedFunc() 

    This is correct, as the usage.txt file is meant to show the class or removed function during compilation as mentioned in

    However, if I change my class to a lazy as shown below,

    class MainActivity : AppCompatActivity() { private val obfuscatedClass by lazy { MyObfuscatedClass() } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) obfuscatedClass.usedFunc() } } class MyObfuscatedClass { fun usedFunc() {} fun unusedFunc() {} } 

    When I check the usage.txt, I notice that both also shown, just in a different section

    com.example.myobfuscateretracetest.MyObfuscatedClass: public final void unusedFunc() // ... other sections com.example.myobfuscateretracetest.MyObfuscatedClass: public final void usedFunc() 

    Why is the usedFunc() still being shown in the usage.txt?

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

    No comments:

    Post a Comment