how to load a file during run time - android

Suppose i have an application "MyApp" which has a button and when clicked it should start another application say"App2" but this "App2" should not be installed on the phone it should dynamically be executed.how do i do this in android.it will be helpful if u can explain with some sample code .
thank u

As I know, if you want an app to run on the phone. You should have it installed or install after the your presses the button. It cannot be just run from the RAM and close it..
Other way round is, You have two activities 1. main and 2. supporting.
Onclick of button on main, you invoke the supporting activity. But this supporting activity should be a part of the main app. Hence it will not be installed as a separate application.
Regards,
Vinay

Related

Appium can't find any element on second activity, shown above first one

I am up to write Selenium+Appium test for Android app.
This app has activity with button. Tapping this button will open another activity above first one. So at this moment there will be 2 activities for application (I can see this if in Android Studio I will execute "Layout inspector" for my app, and Studio will ask me in "Select window" dialog which activity to use).
With apium I can work with first activity, but not with second. I can not find any element with any was (by id, by Xpath). Even tap on screen with TouchAction does not work on second activity. I tried dirrerent real devices and Emulators.
When I use driver.currentActivity() command, I will see that driver is using second activity.
But I have really no clue what to do and how fix this.
Hope you solved same problem and can help me.
Thank you.

Is it possible to open an app in a small window WITHIN my own app?

Currently I am trying to build my school project in Android and I am afraid I have chosen a really difficult project to complete. I would ask if it is possible to open a 3rd party application in a small window within my application. When I try to start a 3rd party application via a button click, the application starts and I cannot go back to my application any more. I want to start another application IN my application, take a screenshot of it, and close this small window. I would kindly ask you to help me in this subject. Thank you very much in advance.
I would ask if it is possible to open a 3rd party application in a small window within my application
No, sorry.
I want to start another application IN my application, take a screenshot of it, and close this small window
You can start an activity via startActivity(). With user permission, you can take a screenshot of whatever is on the screen, by means of the media projection APIs. You cannot:
embed the UI of the other activity in yours
open the other activity in a "small window" (though the user could, using split-screen capabilities in Android 7.0+)
At the end of the day, I decided to use multiwindow. Adding the line below into my code, I made it to run in a small window. Then I was able to start the other activity in the big window.

Android app shortcut does not have name and also the app does not appear in multi-task

Problem 1:
I have developed a app which works fine but when it is installed a shortcut gets created by default as in most android devices . The shortcut just has a logo and not the name of the app. Whereas the app does have name/label in menu.
Problem 2:
The app also doesn't shows up in the multi-task(when the box button is pressed --android L), the app quits on pressing the multi task button and when restarted it starts from where it was left. so the activity is not killed but still does not show among the background processes in multi task view.
If there is a need of any code , please ask for it.
Any help is appreciated.
Problem 1:
Did you set the name of the app?
Problem 2:
Don't have a lot to go with so...
What launchMode property are you using in the activity?
Sorry i didnt add the Android.manifest file, apparently i had a blank label for my launcher activity. Giving it a value made it work.
<activity... android:label=""/>

mGWT State management

During testing of mgwt application in emulator, if we suddenly stop and go to home page in emulator and start the application again, it will directly load the last page where we were wokring. Why it is not resetting it to the first page?
In GWT on module function, I am always loading the default place. I need to explicitly go and remove data and then start application to proceed.
How to overcome this problem programatically? Do we have any reference for it? I have not used gwt-phonegap, it is just mgwt with GWTp framework application.
I think your application isn't stopped. I think it is running in background. If you bring it back to front, it shows the same screen again.

Android app - Integrate another apk

I am developing an application in android. I have situation wherein I have the need to call another app from the main app. Basically when the user presses a tab in the main app the second app should open and it should remain within the main app tab view.
I have developed the complete code for the main app. I also have the source code for the second app and the apk. I am totally not sure as how to integrate the 2 apps. Based on references I am understanding that we can call the apk of the second app from the first, but I am not clear on the same. Please advice or suggest any steps towards the same.
Regards,
Harry
You can't have one application load inside a tab of another application. You can easily have one application start a second application.
How to call one android application from another android application
I hope this helps.
I have situation wherein I have the need to call another app from the main app.
Why? You appear to be the author of both apps. Why not simply combine them?
Basically when the user presses a tab in the main app the second app should open and it should remain within the main app tab view.
This is not supported, on two levels:
You cannot embed another application's UI into your own, except via RemoteViews
Embedding activities inside of activities is now deprecated
I doubt it's possible to open up a view from another app in your existing tab view.
It is however possible to start the activity from another app by a button click. This will then allow you to go back with back button to your own app activity.

Categories

Resources