مقدمة عن nativescript

بسم الله الرحمن الرحيم

السلام عليكم ورحمة الله وبركاته

مقدمة عن إطار العلم nativescript

ماهو nativescipt ؟

nativescript مكتبة عمل مفتوحة المصدر لبناء تطبيقات الهواتف المحمولة بإستخدام native UI للجهاز المستهدف بكود واحد لجميع المنصات
nativescript تم بناء من قبل شركة telerik المملوكة لشركة Progress ( الغنيتان عن التعريف )

ماهي المنصات التي تستطيع البناء لها بواسطة nativescript ؟

nativescript يستطيع البناء للمنصات التالية IOS و ANDROID و WINDOWS UWP بكود واحد

ماهي اللغات التي يستخدمها nativescript ؟

هناك مشروعان في nativescript
الاول هو nativescript core
ويستخدم XML و JavaScript أو Typescript و css أو sass
والثاني المفضل لي هو nativescript with angular
ويستخدم angular و typescript و css أو sass

مالذي يميز nativescript عن المنصات الأخرى مثل react native و cordova و ionic ؟

يختلف nativescript عن ionic و cordova و phonegap
بإنها تكنلوجيا مختلفة جدًا فهي تعمل في الوقت الحقيقي runtime
وهي ليست تقنية web ولا تعمل داخل اطار ويب webview مثل تطبيقات cordova
وايضًا nativescript و react native تستخدم native UI
هذا سوف يعطيك اداء افضل

وتمتاز nativescript عن react native بالوصول الكامل native apis
اي بإمكانك كتابة كود java او objective c بإستخدام javascript فقط دون الحاجة الى بناء ملف jar وإضافته الى مشروعك

مثال لكود objective c

@interface NSObject
+ (instancetype)alloc;
- (instancetype)init;
@end

@interface BaseClass : NSObject
+ (void)baseStaticMethod;
- (void)baseInstanceMethod;
@end

@interface DerivedClass : BaseClass
+ (void)derivedStaticMethod;
- (void)derivedInstanceMethod;
@end
تحويلة الى javascript

function NSObject() { /* native call */ };
// Object.getPrototypeOf(NSObject) === Function.prototype
NSObject.alloc = function () { /* native call */ };

// Object.getPrototypeOf(NSObject.prototype) === Object.prototype
NSObject.prototype.init = function () { /* native call */ };

function BaseClass() { /* native call */ };
Object.setPrototypeOf(BaseClass, NSObject);
BaseClass.baseStaticMethod = function () { /* native call */ };

BaseClass.prototype = Object.create(NSObject.prototype, { constructor: BaseClass });
BaseClass.prototype.baseInstanceMethod = function () { /* native call */ };

function DerivedClass() { /* native call */ };
Object.setPrototypeOf(DerivedClass, BaseClass);
DerivedClass.derivedStaticMethod = function () { /* native call */ };

DerivedClass.prototype = Object.create(NSObject.prototype, { constructor: DerivedClass });
DerivedClass.prototype.derivedInstanceMethod = function () { /* native call */ };

هذا سوف يحل لك الكثير من المشاكل مثل إضافة لم تجدها ويريحك من بعض الإضافات الغير ضرورية
ان شاء الله سوف احاول شرح طريقة التحويل من كود java او objective c الى javascript

ما ميزات nativescript ؟

* nativescript من الاصدار 3 واعلى تستطيع إستخدام جميع الـ packages في npm داخل تطبيقك
* يستخدم javascript و css و xml ( لغات هيكله وتصميم وبرمجة مالوفة لمطوري الويب )
* الوصول الكامل APIs للنظام المستهدف
* بناء المشروع لثلاث منصات بكود واحد
* يتوفر لديه مكتبة إضافات ضخمة plugins.nativescript.org
* يتوفر لديه توثيق سهل ومبسط جدًا مع الامثلة بالصور والاكواد docs.nativescript.org مع API Reference
* التحديث التلقائي للتطبيق في المستعرض بعد التعديل على الكود والحفظ دون الحاجة الى إعادة بناء التطبيق من جديد

روابط خارجية:

موقع nativescript: www.nativescript.org
showcase لتطبقات تم إنشائها بواسطة nativescript: www.nativescript.org/showcases
شاركه على جوجل بلس

عن سالم يسلم

    تعليقات بلوجر
    تعليقات فيسبوك

0 التعليقات:

إرسال تعليق