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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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 Received: by 10.68.19.161 with SMTP id g1mr8398025pbe.7.1319959241631; Sun, 30 Oct 2011 00:20:41 -0700 (PDT) Path: p6ni31503pbn.0!nntp.google.com!news1.google.com!postnews.google.com!t38g2000prg.googlegroups.com!not-for-mail From: Anatoly Chernyshev Newsgroups: comp.lang.ada Subject: Re: Ada 'hello world' for Android; success! Date: Sun, 30 Oct 2011 00:20:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> <9R3rq.3052$pt2.2275@newsfe18.iad> NNTP-Posting-Host: 212.72.17.30 Mime-Version: 1.0 X-Trace: posting.google.com 1319959241 4177 127.0.0.1 (30 Oct 2011 07:20:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 30 Oct 2011 07:20:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t38g2000prg.googlegroups.com; posting-host=212.72.17.30; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 User-Agent: G2/1.0 X-HTTP-Via: 1.1 porxy.unizwa.edu.om:80 (IronPort-WSA/7.1.2-080) X-Google-Web-Client: true X-Google-Header-Order: NKUALESRCHV X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: news1.google.com comp.lang.ada:18760 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-10-30T00:20:41-07:00 List-Id: Thanks Brad for such detailed answer. I rooted my phone first thing I got it from the store. Now it will be good to try some Ada programs on it. On Oct 30, 7:51=A0am, Brad Moore wrote: > 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-c... > > 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 > > =A0 =A0 su > =A0 =A0 mv /sdcard/executable_name /data/data > =A0 =A0 cd /data/data > =A0 =A0 chmod 755 ./executable_name > > =A0 =A0 then ./executable_name =A0to run the Ada executable natively. > > Brad Moore > > > > > On Oct 30, 12:47 am, Brad Moore =A0wrote: > >> 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 abov= e > >>> 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 t= o > >>> 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 > >> =A0 =A0 =A0 Put_Line("Hello, world!"); > >> end Hello; > > >> You may have to root your phone to get this to execute, but it will ru= n > >> and produce the desired output in a terminal console. It wont show up > >> as an app however. > > >> Brad Moore > >