ラベル iOS の投稿を表示しています。 すべての投稿を表示
ラベル iOS の投稿を表示しています。 すべての投稿を表示

2021年3月10日水曜日

祝:MIT App InventorがiOSでも利用可能となった!

素晴らしい朗報が入りました!
 2016年10月にスタートしたこのこのプロジェクトですが、幾多の困難を乗り越え、約4年半の年月を費やし、ついに、MIT App InventorがiOSでも利用できるようになりました(図1)!特筆すべきは、これまでAndroid向けに開発されたソースプログラムは、全くそのままiOS用にも使えるという点です。

 「そんなに大変なの?」と思う人もいるでしょうが、AndoridとiOSという全く異なるアーキテクチャとOSを考えれば、この実現の偉大さは分かると思います。さらに、Appleの強い閉鎖性と極めて厳格な資源管理を考えれば、Apple側との交渉に膨大な時間がかかったことも想像に難くありません。
 マンパワーも膨大であり、約66,000行の新たなプログラム開発になったとのことです。当時、開発費を工面するためクラウドファウンデイングが行われており、小生も、同僚だったH.Tan先生とY.Sud先生と共に幾らかの寄付を行いました。それも懐かしいです。

 現時点では、図2のとおり、iOS用にはインタプリタ方式(Companionで接続)のリリースとなっており、コンパイル方式は2021年秋ころとなっています。また、出来たてなのでもちろん不具合もあるでしょう。それは問題ではありません。とにかく、素晴らしいスタートが切られたことをお祝いしたい!


 この記念すべき出来事を祝って、過去に大学のオープンキャンパスの高校生向け講座のためにつくられたApp InventorソースプログラムをiOSで実行させてみました。図3のとおり、完璧に動きました!この図からも分かりますが、スライダーやボタン等は、Androidとは若干異なる、iOS独特の美しいデザインが感じられます。

 なお、このApp Inventorの例題は、須藤康裕准教授が、ソーラーカーを鈴鹿サーキットで実際に走行させた時にリアルタイムに発進した位置情報を、後でトレースするものになっています。毎秒の位置情報の発信アプリも、須藤先生がAndroid用にApp Inventorで作成されたものです。


2019年4月21日日曜日

Firebase GPS demo made with ThunkableX (common to Android & iOS)

ThunkableX [1] is a kind of software system of App Inventor, which makes it possible to create a common source program for Android and iOS. Some of its functions have not yet been realized, but it is a wonderful system that continues to progress. Here, we created a simple GPS demo program using ThunkbleX.

Suppose Jack and Betty want to show each other the current location on the smartphone in real time. The MIT App Inventor program that realizes it is shown in the literature [2]. It uses the real-time database Firebase, but it is assumed that both have Android devices. By contrast, this article assumes Jack has an Android device but Betty has an iPhone.

I created a ThunkableX app like Fig. 1 below. The source list (block configuration) of the app used here is common to Jack and Betty. Using the Firebase, current positions of each other are displayed in real time. When you press the send button, your location information will be stored in Firebase. Fig. 2 shows the contents of Firebase. If there is a change in the Firebase, the opponent's smartphone immediately updates the map display by seeing the change event in real time.



The whole block of ThunkableX that realizes this is shown in Fig. 3. For reference [2], registration of the listener for change event as shown in Fig. 3(1) was unnecessary. However, the reason ThunkableX needs it is probably because of the commonality with iOS. When you use Firebase, you do not need to make any settings if it is a temporary test program. However, if you use it in a full-fledged app, you will need to set up your own Firebse Database URL and API Key. Otherwise, security issues may occur.


References
[1] https://thunkable.com/#/
[2] USING FIREBASE IN A REAL APP – “HERE I AM!” GPS DEMO APP (https://appinventor.pevest.com/2016/09/13/using-firebase-in-a-real-app-here-i-am-gps-demo-app/)