From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient? Date: Mon, 26 Jun 2023 16:21:52 +0000 Message-ID: <4f26284b-7435-7fb1-425b-b50cb886a07a@pm.me> Reply-To: Ant Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27250"; mail-complaints-to="usenet@ciao.gmane.io" To: 64303@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 26 18:23:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDozw-0006rw-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Jun 2023 18:23:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDozZ-0005rY-FX; Mon, 26 Jun 2023 12:23:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDozW-0005rG-Cf for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2023 12:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDozW-00058K-3w for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2023 12:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDozV-0004xe-Vk for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2023 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Jun 2023 16:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64303 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168779653018987 (code B ref -1); Mon, 26 Jun 2023 16:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Jun 2023 16:22:10 +0000 Original-Received: from localhost ([127.0.0.1]:46918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDoyg-0004wB-Cn for submit@debbugs.gnu.org; Mon, 26 Jun 2023 12:22:10 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDoyd-0004w1-Io for submit@debbugs.gnu.org; Mon, 26 Jun 2023 12:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDoyd-0005HG-9j for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2023 12:22:07 -0400 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDoyb-0004p2-6a for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2023 12:22:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1687796519; x=1688055719; bh=uwNf9edfos3so0d6VNMupgq2CTysu0SrOQQi+6oaJbY=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=IhHUqZoKL/Z34QIq9HpJQzvazSDlWfRGU64J2hqsL2NtaP0Hxt//K1HbFmZfj2Geu lA00SMrmLcJWN/pygtJ0gCVa85aBjE5GDEYNQm0Fnmjv0Ij01rClYnxqogeolXPGp5 nuPns6gs3nJ9WReAj9HqrBpxt6GZkN+piK3SqE56+mScAZhhxcIdIDP4jXY2DPCaLa W72GH8bc+SK39dvCpW4lo6gHh39OW4129eM6AhXApg/Ibm5IFTcX/KU8UX+iUTP5Iw +SBinHbVpHKw8cxSgVwMYTp4iIQqWazHp+1K3izqNhPib8zC1G9qhkGVovYxV9ZuZT G25GqDHZ9YrMg== Feedback-ID: 77338314:user:proton Received-SPF: pass client-ip=185.70.40.133; envelope-from=n58r@pm.me; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264110 Archived-At: The EmacsActivity.java and EmacsOpenActivity.java files show that it is possible to pass argument by means of Android Activities. Furthermore, EmacsOpenActivity (the file that handles Emacs selection in "Open With..." dialogs) does use emacsclient (or its equivalent libemacsclient.so) in order to reuse the same Emacs instance and frame. It is possible to manually invoke Android Activities (with custom=20 parameters) by means of the command "am" in the adb shell, the command "am" in the Termux shell or also by means of some Androids applications like ActivityManager (https://github.com/sdex/ActivityManager) that also allows to make shortcuts out of them. It could be an idea to "generalize" EmacsOpenActivity and to have an activity that allows to insert custom parameters that would be fed to libemacsclient. EmacsActivity.java already does something similar, by means of the extra argument "org.gnus.emacs.STARTUP_ARGUMENT". One use case would be, trivially, to have a shortcut for org-capture or some other org-protocol. I'm not an Android guru myself and so I don't know whether this is a good idea or not, security-wise. Also, I don't know if this is just an hack that won't last too long anyway. I'd like to know your opinions in this regard. Thank you in advance!