android

Whether it is possible to change the Android manifest attribute dynamically?

空扰寡人 提交于 2021-02-18 19:09:40
问题 I need the set the Application attribute dynamically in android , particularly i need set the Name field which is shown below , i need to change it dynamically because i import two library packages each package will contain two different Application class to maintain session variable,but i can able to use any one Application class in imported project, i need to use that both dynamically based on the package user going to use, for that i need to set and change the Application class Name

Whether it is possible to change the Android manifest attribute dynamically?

喜你入骨 提交于 2021-02-18 19:09:27
问题 I need the set the Application attribute dynamically in android , particularly i need set the Name field which is shown below , i need to change it dynamically because i import two library packages each package will contain two different Application class to maintain session variable,but i can able to use any one Application class in imported project, i need to use that both dynamically based on the package user going to use, for that i need to set and change the Application class Name

Listening socket.io events and updating LiveData (a class of android.arch.lifecycle)in application class android

早过忘川 提交于 2021-02-18 19:08:53
问题 I am working on a chat application and Currently I am listening and emitting socket events in an Activity. Now i want to listen all the socket events even when chat activity is not in foreground as i want to store all the messages from different users in the local DB at the same time i want to update LiveData to update UI. In order to achieve this I am listening socket events in the Application class as following: public class ChatApplication extends Application { public Socket mSocket;

programmatically taking screenshot of current screen in android device?

点点圈 提交于 2021-02-18 19:05:14
问题 I am working on an app in which I have some edit texts and background image. I wrote something in that edit text, I want to save whole current screen as an image, so that I can send it via email. I got a solution using ASL(android screenshot library) but for this I have to start native service on my device every time when I reboot it. So is there any other solution to take screenshot of current screen? 回答1: Try this.. find the Parent layout in you xml and do this. LinearLayout ll =

How to add testInstrumentation environment variable for firebase testlab?

旧时模样 提交于 2021-02-18 18:57:43
问题 If i am going to run espresso test locally and pass enviroment variable i can do this by adding defaultConfig { testInstrumentationRunnerArgument 'USERNAME' 'David' } in build.gradle file then i can call this variable by InstrumentationRegistry.getArguments().getString("USERNAME") but when i run this on firebase testlab instrumentationrunner argument are not working 回答1: This is not supported in Test Lab. If you really need to do this, there's a workaround by overriding the test runner and

How to display image with intent.ACTION_VIEW

拈花ヽ惹草 提交于 2021-02-18 18:56:37
问题 My grammar can run at android 5.1 but is not working at android 7.1.... File file = new File(Environment.getExternalStorageDirectory(), "Pictures/1481853170451.jpg"); Toast.makeText(MainActivity.this, file.getPath(), Toast.LENGTH_LONG).show(); Uri path = Uri.fromFile(file); if (file.exists()) { Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(path, "image/*"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { this.startActivity

How to display image with intent.ACTION_VIEW

一曲冷凌霜 提交于 2021-02-18 18:56:23
问题 My grammar can run at android 5.1 but is not working at android 7.1.... File file = new File(Environment.getExternalStorageDirectory(), "Pictures/1481853170451.jpg"); Toast.makeText(MainActivity.this, file.getPath(), Toast.LENGTH_LONG).show(); Uri path = Uri.fromFile(file); if (file.exists()) { Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(path, "image/*"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { this.startActivity

How to add testInstrumentation environment variable for firebase testlab?

喜欢而已 提交于 2021-02-18 18:55:26
问题 If i am going to run espresso test locally and pass enviroment variable i can do this by adding defaultConfig { testInstrumentationRunnerArgument 'USERNAME' 'David' } in build.gradle file then i can call this variable by InstrumentationRegistry.getArguments().getString("USERNAME") but when i run this on firebase testlab instrumentationrunner argument are not working 回答1: This is not supported in Test Lab. If you really need to do this, there's a workaround by overriding the test runner and

Create Custom URL protocol in Android

纵饮孤独 提交于 2021-02-18 18:54:37
问题 How can I create a custom protocol in Android? I have tried this code: <activity android:name=".MyActivity" android:label="@string/app_name"> <!-- open the app when a foo://www.example.com link is clicked --> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="foo" /> </intent-filter> Register this in Manifest file and call in browser

Android Studio Robotium Recorder Plugin Compatibility issue

好久不见. 提交于 2021-02-18 18:53:35
问题 I have Android API Levels 15,19,20,21 and Android Studio 1.0.1. Robotium Recorder needs API 15 or higher version. Information about Robotium API support I follow that guide from Robotium's page and also I tried many things like those (all following steps were tested separately from each other); I created emulators that's API level 15 and 19, Than I tried to start Robotium,It did not work. I connected my Android phone which is API level 19,that did not work again. I started Android Studio with