Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to launch the my flet apk to another apk(java/kotlin) #4923

Open
1 task done
JayasuryaDaikoku opened this issue Feb 20, 2025 · 4 comments
Open
1 task done

how to launch the my flet apk to another apk(java/kotlin) #4923

JayasuryaDaikoku opened this issue Feb 20, 2025 · 4 comments

Comments

@JayasuryaDaikoku
Copy link

Duplicate Check

Describe the bug

Hello everyone,

     I am facing the issue while launching the another apk from my flet(0.25.2) apk. I checked in the termux opening the another apk is working fine.

Example(am start -n org.thoughtcrime.securesms/.RoutingActivity) but i built the apk included with this code while opening the another apk I am getting this error message.

Command Output:', 'Activity mandy (tity) commands:\n help\n Print this help text.\n logging \n app-logging <PROCESS_NAME> \n start-activity [-D] [-N] [-W] [-P ] [--start-profiler ] \n [--sampling INTERVAL] [--streaming] [-R COUNT] [-S]\n [--track-allocation] [--user <USER_ID> | current] \n Start an Activity. Options are:\n -D: enable debugging\n -N: enable native debugging\n -W: wait for launch to complete\n --start-profiler : start profiler and send results to \n --sampling INTERVAL: use sample profiling with INTERVAL microseconds\n between samples (use with --start-profiler)\n --streaming: stream the profiling output to the specified file\n (use with --start-profiler)\n -P : like above, but profiling stops when app goes idle\n --attach-agent : attach the given agent before binding\n attach-agent-bind : attach the given agent during binding\n -R: repeat the activity launch times. Prior to each repeat, \n the top activity will be finished.\n -S: force stop the target app before starting the activity\n --track-allocation: enable tracking of object allocations\n --user <USER_ID> | current: Specify which user to run as; if not\n specified then run as the current user.\n windowingMode <WINDOWING_MODE>: The windowing mode to launch the activity into.\n --activityType <ACTIVITY_TYPE>: The activity type to launch the activity as.\n --display <DISPLAY_ID>: The display to launch the activity into.\n --splashscreen-icon: Show the splash screen icon on launch.\n start-service [--user <USER_ID> | current] \n Start a Service. Options are:\n --user <USER_ID> | current: Specify which user to run as; if not\n

specified then run as the current user\n start.

Thank you do the needful.

Code sample

Code
 def audiocallmessage(self,event=None):
        print("audio call")
        self.show_notification("audiocall." , color="green")
        time.sleep(5)
        command = ["am", "start", "-n", "org.thoughtcrime.securesms/.RoutingActivity"]
        try:
            result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            print("Signal app started successfully.")
            message = "Command Output:", result.stdout.decode()
            self.show_notification( message, color="green")
            print("Command Output:", result.stdout.decode())
        except subprocess.CalledProcessError as e:
            print("Failed to start the app.")
            message = "Error:", e.stderr.decode()
            self.show_notification(message , color="red")

To reproduce

Check this source code.

Expected behavior

It needs to open the another apk.

Screenshots / Videos

Captures

Image

Operating System

Windows

Operating system details

windows 11

Flet version

0.25.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

@ixenion
Copy link

ixenion commented Feb 20, 2025

Did you try flet last version 0.26.0 ?

@JayasuryaDaikoku
Copy link
Author

No, I haven't tried Flet version 0.26.0 yet.

@JayasuryaDaikoku
Copy link
Author

Do I need to give any permissions in the pyproject.toml file?

@ixenion
Copy link

ixenion commented Feb 21, 2025

AI suggests this:

Grant necessary permissions:
You may need to add specific permissions to your app's AndroidManifest.xml file. For example:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

In flet you'd do like this:

flet build apk --permissions permission_1 permission_2

Try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants