» »

Razvoj mobilne aplikacije Kivy vs Ionic

Razvoj mobilne aplikacije Kivy vs Ionic

i33a ::

Pozdravljeni, na nekem projektu moram razviti aplikacijo, ki bo delovala tako na iOS, kot Android telefonih.
Zanima me kateri cross plaform framework priporočate?
Ogledujem si Kivy in Ionic, Cordova, ... Najbolj me mipa Kivy, saj znam Python najbolje. Ionic izgleda sicer super, a žal nimam pojma o Angular-ju. Kaj priporočate? Ima kdo izkušnje z temi frameworki?
(Aplikacija bo vsebovala neke grafične gradnike, nekaj preračunavanja(ne spet preveč zahtevnega), pošiljanje datotek preko bluetooth).

Lep pozdrav in hvala za odgovore.

nightrage ::

Meni je sicer libgdx zelo všečen, programiraš pa v javi. Cocos2d je še bolj priljubljen programiraš v c++.
Oglej si game engine na https://github.com/showcases/game-engin...

jukoz ::

Mi uporabljamo Kivy, zaradi pythona in posledično hitrejšega razvoja.

i33a ::

@nightrage
Hvala, bom pogledal še te frameworke.

@jukoz
Super. Imate dobre izkušnje z njim? Kje predlagaš, da se ga začnem učiti?
Pa omogoča tudi pošiljanje datotek preko bluetooth-a(to je nujna zahteva za aplikacijo)?

kuall ::

To vprašanje je tudi mene zanimalo in sem pred časom naredil raziskavo, kaj ima največ smisla. Prišel sem do zaključka da je najboljši Xamarin native. Zato, ker app dela hitro, razvijaš v prijetnem C# jeziku in podvajanju kode za različne OS-e se lahko izogneš večinoma.

Spodaj je članek o tej raziskavi, ki sem ga napisal zase (da ne bom pozabil, ker imam slab spomin:) in sem ga hotel tudi objavit na codeproject ampak so mi ga vrgli dol idiotki.


Introduction



I did my own research which framework makes the most sense to chose
of all the possibilities. It was consufing so I wrote this article to
make it clear to myself and to anyone else who will read this.



Background



I'm C# web developer, who likes using Visual Studio, so I am probably a little biased here.



Our choices



Xamarin native

Pros:

+ Codebehind is shared between platforms.

+ It should be as fast as native. Maybe starup time and app size suffers a little.

+ You write code in one good language, C#, and in good IDE, Visual Studio.

+ Using Xamarin.Mobile library decreases amount of platform specific code (camera, ...)

Cons:

- You have to write separate UI for each platform.



Xamarin.Forms

Pros:

+ No code duplication. One UI and and codebehind (at least in theory).

Cons:

- Slow

- You don't have full acess to all the native functionalities



Fully native (Java, Objective-C)

Pros:

+ Speed

+ A lot of examples on the internet

+ You don't have another layer on top that could cause bugs which you would have to overcome and waste your time with.

Cons:

- You have to write program twice in two different languages from
scratch. Code duplication (synchronization) is a nightmare for
developer.

- You have to learn 2 new languages. If you are web developer you
already have enough languages to keep in your head, you don't need
another two to cram your brain.





Other choices are just some crappy slow cross platform solutions that run in web views (AFAIK, correct me if I'm wrong :) ).



 



Performance



Performance is the most important thing for an app, that's what users
notice and what drivers users away from your app if it's slow. Here is
what I found out:

Xamarin.Forms is too slow. Especially startup time and app size are bad.

Some things people say:

- https://forums.xamarin.com/discussion/c...

- Chaldal e-commerce app, which was written in Xamarin.Forms, takes 10 seconds to load on my Samsung Galaxy S4. Too slow.

His post on forum: https://forums.xamarin.com/discussion/8...



Xamarin native should be as fast as native apps written in Java/Objective-C(or Swift):

https://medium.com/@harrycheung/mobile-...



 



The winner



So Xamarin native is our choice. Below is a short tutorial how to use
it. It is for Visual Studio 2015 and Xamarin installed in it.



 



Creating blank Xamarin native project



- In Visual Studio create shared project. Templates/Visual C#/Shared Project. Name it YourProject.



- Add Android project to solution: Templates/Visual C#/Android/Blank App(Android). Name it YourProject.Droid.



- Add iOS project to solution. Templates/Visual C#/iOS/iPhone/Blank App(iPhone) Name it YourProject.iOS.



- Add reference to shared project to both native projects: right
click References, Add reference, click Shared Projects, tick
YourProject. Your put here all your non-UI specific code, all the
codebehind. Majority of your code will be here (especially in large
projects).

If you now run project it should successfully deploy blank app to your phone.

Good guide: https://developer.xamarin.com/guides/an...



 



Testing iOS apps on Windows



You need a physical MAC computer to test your iOS apps. No other way around it. So best is to buy an iPhone IMO.

Another problem: Note that in order to distribute the Xamarin.iOS you
must be a member of Apple’s Developer Program. This program requires an
upgraded membership that costs $99 USD/year. Source: https://developer.xamarin.com/guides/cr...



 



Android Lollipop OS problems/bugs



Xamarin + Lollipop + Samsung Galaxy S4 I9505 = problems



Problem 1:

When you try to deploy Xamarin projects using the above combination it
will not succeed. Solution is to downgrade to KitKat OS (4.4.?).



Problem 2: back and menu buttons don't work. Very annoying.



Solution how to downgrade to kitkat:

This is what worked for me after trying a few solutions that did not work:

http://trueandroid.com/en/i9505xxufnad-...



Also set your phone to not automatically download and update to
Lollipop (I upgraded to Lollipop twice because one time in the morning I
mistakenly pressed install instead of cancel button):

Just disable auto updates in Play Store app's settings:

http://www.greenbot.com/article/2847267...



 

i33a ::

@kuall
Hvala za predlog. Sem tudi sam razmišljal o Xamarin-u, a sem omejen na razvoj na Linux-u.

jukoz ::

i33a je izjavil:


@jukoz
Super. Imate dobre izkušnje z njim? Kje predlagaš, da se ga začnem učiti?
Pa omogoča tudi pošiljanje datotek preko bluetooth-a(to je nujna zahteva za aplikacijo)?


Ja, mal je bil problem pri migriranju na novo verzijo, ampak to je bilo leta 2015 (prvi sw smo razvili 2013).
Glede pošiljanja datotek ti ne znam povedati nič pametnega, se pa povezujemo preko BT-ja.

V bistvu je to BT na RS-232, RS-485, RS-422 ali 20mA zanko. Priklapljamo se na stare industrijske krmilnike z Android aplikacijo in ustreznim pretvornikom nadomeščamo namenske in precej drage terminale, ki se jih v večini ne da več kupiti. Za vsako mašino je potrebno skopajlat svoj SW, ker ima vsaka neke svoje parametre, ampak osnova za prikaz in gumbe pa ostaja enaka na vseh.

Pomoje pošiljanje preko BT ne bi smel biti problem, saj tako ali tako kliče sistemske funkcije za BT.
Te pa opozarjam, da je precejšna razlika v delovanju BTja med različnimi proizvajalci HWja.

Naša aplikacija deluje samo na Androidih od 4.0 naprej, ampak ima vsak proizvajalec HWja različen način. Sistemske funkcije so sicer iste, ampak npr delovanje BTja na Androidu 4.4 od LGja ali Samsunga je precej različen.

App je pa tole:
https://www.komna.com/sl/vrsterm/


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Xamarin in android C#

Oddelek: Programiranje
61337 (737) Lonsarg
»

cross platform development

Oddelek: Programiranje
367336 (6322) slodreamer
»

Mono Develop .net

Oddelek: Programiranje
102331 (1902) Lonsarg
»

Microsoft odprl kodo .NET

Oddelek: Novice / Ostala programska oprema
3614419 (11413) jype
»

Android app - SDK ali kaj drugega?

Oddelek: Programiranje
152170 (1656) nekdonekje

Več podobnih tem