kara_mara

joined 11 months ago
[–] kara_mara 1 points 9 months ago* (last edited 9 months ago)

there're internal and exteranl SSD drivers. The internal one can't be used externally because there's nothing to plug it into. USB isn't supported.

Which one do you refer to?

 

I have an Android app which needs to run an overlay activity with some content in it over other apps on the phone at the moment they start or get focused. For this, I use AccessiblityService:

    override fun onAccessibilityEvent(event: AccessibilityEvent) {
        if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
           if (cond1) {
              
              // (!)
              // this will get triggered properly
              //

             val intent = Intent(this, MyOverlayActivity::class.java)
             intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP


             startActivity(intent)
           }
        }
    }

However, it'll only get launched properly whenever I switch to my own activity - MainActivity.

What's the matter?

MyOverlayActivity:

    class MyOverlayActivity : AppCompatActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)

            // 1
    //        window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY)
    //        val layoutParams = WindowManager.LayoutParams(
    //            WindowManager.LayoutParams.MATCH_PARENT,
    //            WindowManager.LayoutParams.MATCH_PARENT,
    //            WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
    //            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
    //            PixelFormat.TRANSLUCENT
    //        )
    //        window.attributes = layoutParams
            //



            // 2
            window.setFlags(
                WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
            )
            window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
            window.setLayout(
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT
            )
            window.setGravity(Gravity.BOTTOM)
            //


            setContentView(R.layout.activity_my_overlay_layout)
        }
    }

Manifest


    <!-- [.............] -->
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <!-- [.............] -->

    <activity android:name=".MyOverlayActivity"
        android:exported="true"
        android:theme="@style/AppTheme.TranslucentNoTitleBarFullscreen"
        android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboardHidden|keyboard|navigation">
    </activity>

Note I've given the permission required to my app in Acessibility.

[–] kara_mara 1 points 9 months ago

Yes, I allow you to Google that for me, my son.

1
submitted 9 months ago* (last edited 9 months ago) by kara_mara to c/windows
 

That is, a Windows must be booted and run completely from an external drive, be able** to save settings** and data, and all other stuff -- perform all the things that a Windows installed normally, on an internal drive, does.

As far as I know, WinToGo doesn't work anymore. And I even have never used it anyway.

What works nowadays? Will Rufus be able to do this?

[–] kara_mara 1 points 9 months ago

The question isn't about that.

0
submitted 9 months ago* (last edited 9 months ago) by kara_mara to c/cryptocurrency
 

In Ethereum the gasLimit is 21000. The constant.

I haven't found anywhere the value of it for Polygon, though. How much is it? For a token as well as for MATIC itself.

I've found the number 57000 on an explorer in a real TX. Yet I haven't been able to find a confirmation for it elsewhere.


What I need is to specify a limit in my codebase for transfers of MATIC and tokens only. There won't be any calls to smart-contracts. What number should I put there?