From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4cb1f8d1c17d39a8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.30.34 with SMTP id p2mr8054080pbh.4.1319946693361; Sat, 29 Oct 2011 20:51:33 -0700 (PDT) Path: p6ni29900pbn.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe18.iad.POSTED!00000000!not-for-mail From: Brad Moore User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada 'hello world' for Android; success! References: <8239efcjuw.fsf@stephe-leake.org> <98ca5430-aa52-4e39-b789-70d0dd6adb46@d33g2000prb.googlegroups.com> <824nyrq5p6.fsf@stephe-leake.org> <5e4cbab8-b375-4995-bf1a-e264b307a279@d37g2000prg.googlegroups.com> <0EZqq.6778$rF5.1568@newsfe19.iad> In-Reply-To: Message-ID: <9R3rq.3052$pt2.2275@newsfe18.iad> NNTP-Posting-Host: 184.64.75.84 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: newsfe18.iad 1319946693 184.64.75.84 (Sun, 30 Oct 2011 03:51:33 UTC) NNTP-Posting-Date: Sun, 30 Oct 2011 03:51:33 UTC Date: Sat, 29 Oct 2011 21:51:31 -0600 Xref: news1.google.com comp.lang.ada:18759 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-10-29T21:51:31-06:00 List-Id: On 29/10/2011 3:59 PM, Anatoly Chernyshev wrote: > I see. So, it's all about making a nice GUI for "Hello world"? Then > I'm relieved, as I commonly don't do the interface. > For that simple example below, should I just compile it for jvm, and > then it can be run on Android? Yes, Stephen Leake's example shows how to integrate a GUI into an app written in Ada on Android. The GUI libraries are written in Java, so Ada has to interface with Java to use those. To build the native Ada console executable however, the jvm isn't in the picture at all, as I understand it. I found the following post helpful in getting Ada code to compile on Android. http://www.rhinocerus.net/forum/lang-ada/684457-gnatdroid-ada-cross-compiler-arm-android-incorporated-intofreebsd-ports-tree.html Basically, what I did was create a virtual machine that runs FreeBSD, on my desktop, Next I followed the instructions in the above post to install the compiler into the virtual machine. Then I used the gnatmake executable (arm-android-eabi-gnatmake) on the virtual machine to cross-compile my source code for Android. This built the executable, which I then transferred to my smartphone's sdcard. (I used AndFTP to do the transfer, though in theory one should also be able to use one of the ssh apps (eg SSHDroid) to transfer from the virtual machine to the android. I didn't have any luck getting SSHDroid to work, but AndFTP did work fine. Since you can't execute files from the sdcard, I had to root the phone, so that I could then copy the executable to /data/data. To root my phone, I followed the procedure for SuperOneClick, which you can find with google. One rooted, I installed an app called "Terminal Emulator" on my Android, which allowed me to enter commands in a linux like environment. I also installed BusyBox to give me linux commands I am familiar with. Within the terminal emulator, I issued su mv /sdcard/executable_name /data/data cd /data/data chmod 755 ./executable_name then ./executable_name to run the Ada executable natively. Brad Moore > > On Oct 30, 12:47 am, Brad Moore wrote: >> On 29/10/2011 8:46 AM, Anatoly Chernyshev wrote: >> >> >> >>> Well, I have HTC too, and might be willing to do some programming on >>> it (to have some use of GPS data for instance). But your example above >>> just scares me away. >>> And I'm happy to have no employer to force me digging into this. I >>> will not approach any Android programming in Ada until it gets back to >>> the simplicity of e.g. >> >> >> Note if you just interested in writing "Hello World" to a console for >> Android, you can still use the traditional Hello world program for Ada. >> >> namely; >> >> with Text_IO; use Text_IO; >> procedure Hello is >> begin >> Put_Line("Hello, world!"); >> end Hello; >> >> You may have to root your phone to get this to execute, but it will run >> and produce the desired output in a terminal console. It wont show up >> as an app however. >> >> Brad Moore >