Mobile App Development - Page 1
Forum section: electronics / general

author: Wilksey
author_rank: Super Contributor
timestamp: November 09, 2016, 10:54:42 am
content: For a while I have been developing Android apps, using just the Android Studio, now I have had a few questions asking about iOS support, obviously, this isn't a simple click another button and voila, iOS app ready!So, I have seen several cross platform development tools, but a bit overwhelmed to be honest, I need to be able to access peripherals on the device, such as BLE, GPS, etc, all of which I can do with Android Studio.Is it best to stick with native tools for each platform, will it be a lesser headache to recreate the app several times? (I am assuming this is NOT the best option)What are the more frequent used tools, preferably free as Android Studio is free, not sure about iOS, probably not if Apple is involved.On the subject of Apple, would I require a Mac to build the iOS targeted app or can I do it under Linux say?Do I need to worry about Windows phone users, I don't know many who uses Windows on their mobile anymore.TIA!

author: @rt
author_rank: Super Contributor
timestamp: November 09, 2016, 12:16:49 pm
content: The last I did iOS apps, you needed an Intel based Mac to run Xcode,and the MAC mini was sufficient. It did become a slug when I started using itas a general purpose desktop.It does hard it's quirks (Objectionable C) but the tools are nice.It is possible to write an entire app in C once you have somebasics down such as talking to the hardware, file IO, etc.

author: spudboy488
author_rank: Regular Contributor
timestamp: November 09, 2016, 12:52:31 pm
content: If you are familiar with Visual Basic, take a look at the development tools at Anywhere Software (https://www.b4x.com/). I have used the Android product only so i can't comment on the Apple version but I believe they are very similar.

author: Wilksey
author_rank: Super Contributor
timestamp: November 09, 2016, 01:24:31 pm
content: Thanks,VB6 yes, VB.NET, no, I switched to C#.Spudboy, do you know if B4A supports accessing the peripherals like BLE under Android?Does it require a "bridge" to run? Some other tools I used require an app to be installed to be able to run the app, almost like a framework I suppose?I'll download the Java and Arduino free versions to see what they are like, I assume the B4A is similar.Cheers!

author: matseng
author_rank: Frequent Contributor
timestamp: November 09, 2016, 01:37:45 pm
content: Have you looked into Cordova? It was highly recommended by a friend of mine but I haven't started using it myself yet, maybe sometime when I have a week to learn a new environment I might get around to it....It got built-in access to many native features of the supported targets, and stuff like BLE is accessible by plugins to the core system.https://cordova.apache.org/docs/en/latest/guide/support/index.html

author: Wilksey
author_rank: Super Contributor
timestamp: November 09, 2016, 01:55:06 pm
content: I haven't looked at Cordova, no, it seems to be install-able via NodeJS, so I might give it a bash later!Thanks.

author: Ampera
author_rank: Super Contributor
timestamp: November 09, 2016, 02:06:15 pm
content: Development for Apple SUCKSIn every way it could, the language options SUCKThe hoops to jump through SUCKThe possibility of the almighty appstore gods not liking your app SUCKI know this isn't very helpful, but it's just not worth it, nobody using an iPhone right now deserves to have decent apps, because Apple is such a friggin bugger with app devs. The only reason they have anybody doing anything at all is their ubiquity. Andorid is a FAR superior platform for app development as you can use, oh let's say, more than a few languages at all. You also have better bindings to hardware resources, and better support for things like OpenGL ES and Vulkan APIs. Apple SUCKS. You could make a jailbroken app, but that's only SLIGHTLY better and doesn't give you the target market. On Android if your app doesn't get to the store you can still get people to install it easily. With Apple, no appstore means no app whatsoever.

author: Wilksey
author_rank: Super Contributor
timestamp: November 09, 2016, 05:31:21 pm
content: Yeah, i'm not an Apple fan boy either, unfortunately, no matter how much you hate Apple for whatever reason, people still use it and buy their products, iOS is still a popular platform, personally, i'm Android all the way!

author: JPortici
author_rank: Super Contributor
timestamp: November 09, 2016, 06:15:15 pm
content: Quote from: Wilksey on November 09, 2016, 01:24:31 pmshould be VB6. we use it at work. well.. not me, my colleague.

author: Wilksey
author_rank: Super Contributor
timestamp: November 09, 2016, 06:39:08 pm
content: Few options to try, i'll evaluate a few and see how I get on!No I don't have a hatred for MS lol, I use whatever I need to.

author: kaz911
author_rank: Super Contributor
timestamp: November 09, 2016, 06:47:30 pm
content: I use Xamarin C# for Android and iOS - actually really coolIt is now owned by Microsoft - but works fine - and lots of free versions available.

author: @rt
author_rank: Super Contributor
timestamp: November 09, 2016, 06:58:55 pm
content: Why not say how you really feel?I don't understand really. I found Xcode great once figured out,and for languages, I suppose I just favour C for such a platform anyway.Five of my five Apps were accepted first go, but once I was sick of it,a sixth App, which was an accurate simulation of their own Music Appfrom a previous iOS version was rejectedI just hate Apple for entirely different reasons... More from a customers point of view.Quote from: TwoOfFive on November 09, 2016, 02:06:15 pm

author: spudboy488
author_rank: Regular Contributor
timestamp: November 10, 2016, 01:12:53 pm
content: Quote from: Wilksey on November 09, 2016, 01:24:31 pmThe environment is VB'ish. It has a similar RAD feel and the language is similar. The code, once compiled, is native java. No runtimes or framework like VB6 or .NET apps. There is a bridge that is loaded for debugging but the released app doesn't require it.Peripheral access is through various libraries that are available to be used in the registered version. I've actually used the BLE library (and had input to the developer to enhance its function).They do have a trial version of the Android product (B4A) that you can try to evaluate the environment. There are some limitations such as you can only sign the app with the debug key and limited (if any) external library support. A big plus is the user forums where a lot of the new libraries come from. For me, this was a no-brainer development system.

author: Wilksey
author_rank: Super Contributor
timestamp: November 10, 2016, 01:45:10 pm
content: Hi Spudboy,Good to know, I have downloaded the demo /trial, not ran it yet.It's $59 so it isn't too expensive compared to some others, the iOS version is the same price.I'll also see what the free offerings are as mentioned here.Cheers

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: November 10, 2016, 02:00:16 pm
content: Quote from: TwoOfFive on November 09, 2016, 02:06:15 pmNot really. There are problems, but let's keep the hyperbole under control.QuoteNot really. You can program in C, C++, Objective-C and Swift. Might be an issue if you're after Java or C#, but then you can use IntelliJ or the former. Can't remember what solutions are for C#, as I don't program in that.BTW, you can even mix languages in the same project if you want (Xcode). Generally that's bad practice, unless you are writing bridging code for libraries. For example, I'm developing cross platform framework in C++14, which has a thin facade layer written in Objective-C++ which allows bindings in pure Objective-C or Swift code. The fact that Apple could get this working together smoothly (straight out of the box, no third party tools) is just amazing. Try to do that in Java.QuoteLike what? Create a dev account, download Xcode, and you are good to go. If you want to go on the app store, yes, you'll have to jump a hoop or two to get certs happening and get app approved. But to just code, you don't need any of that.BTW, Xcode is kinda sucky (but what IDE isnt?), depending on what you are doing, but there are alternatives, such as QT or AppCode.QuoteFor iOS, Appstore is a must, but for macOS desktop you don't need to go through the Appstore. You can either ditro the binary yourself or use other services such as Fastspring. I *think* -- don't quote me on that -- Fastspring might be available for iOS apps as well.QuoteI think that's poor advice. If you want to LEARN how to code on a particular platform, then it's absolutely worth it.QuoteTwo gripes with Apple: 1. The appstore; 2. lack of Vulkan support and/or outdated OpenGL support. Everything else is just meh.

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: November 10, 2016, 02:23:29 pm
content: Quote from: Wilksey on November 09, 2016, 10:54:42 amFew tips with cross platform development:1. Choose a platform neutral language for implementing the bulk of the project. C, C++ are good choices, and probably are the only realistic choices.2. Choose libraries that is widely supported on many platforms in your chosen language. Depending on what you are after, but I usually lean on things like libpng, libjpeg-turbo, boost and so forth.3. Split your project into two major components, the front-end and the back-end:3 a. The back-end is written in platform neutral language, using cross platform libraries. The bulk nuts and bolts detail for your app should be implemented here, and write it as a self-contained framework, or library. For example, if you develop the game, you put the game engine in the back-end, and expose its functionality via an API. This a API is essentially a wrapper for your platform neutral language, and exposes bindings for your front end in whatever native language your current platform uses (eg Objective-C).3 b. The front-end is where the user interface is implemented. Here you use idiomatic language for the platform and its sole purpose is to hook up user input and presentation with the back-end via the aforementioned API. You also access hardware specific input/output and delegate that to your back-end via the API. Also, I recommend to re-implement the UI (and peripheral interface routine) natively for each platform you're targeting for. Extra work, yes but alternatives exist on that front, such as QT. But they are hit and miss, and kinda look a bit out of place, or their user input behaviour is not consistent with the platform. For mobile, QT might not be a good choice anyway (I haven't tried, so take this advice with a grain of salt).4. Develop your back-end simultaneously on all platform you are targetting. That is, make sure it builds. That way you can incrementally catch issues that are platform specific, like weird compiler behaviour, unintended platform specific code creeping in, et cetera.

author: Wilksey
author_rank: Super Contributor
timestamp: November 10, 2016, 06:11:27 pm
content: Hi AntiProtonBoy,Thanks for the tips!

author: Howardlong
author_rank: Super Contributor
timestamp: November 10, 2016, 07:38:17 pm
content: I did some cross platform mobile development using Marmalade. I chose that platform because at the time there was nothing else available that allowed you to write cross platform native code for mobile platforms, and the application was very heavy real time on device DSP number crunching. It is C++ based, and you need to learn their way(s) of doing things, but at least you only need to the one framework.The main negative side was that you always seemed to be on the bleeding edge. The licensing was a PITA too, with it phoning home all the time. As well as mobile platforms, it also creates desktop versions of your app for OSX and Windows, but it didn't do desktop Linux versions.You don't need a Mac to develop for it either, it uses Visual Studio on a PC or Xcode on a Mac as IDEs, although you do need a Mac to upload your app to Apple, and you might need a Mac to register your IOS devices for debugging. You debug in an emulator, there was no on-device debugging. You can deply your app directly to your provisioned IOS device from a PC (or a Mac of course).Unless things have changed, dealing with Bluetooth would mean you need to develop your own native imterface for each device.I think next time I will give Xamarin and Qt an evaluation. I'm a C/C++ dude, without much C# exposure although I've dealt with its deployment nuances since its inception, but C# seems a reasonable route nowadays.In general one of the biggest frustrations I found developing for IOS was all the provisioning nonsense you have to go through. It may have improved recently but frankly it was a tortuous process, and I was not really sure what I was doing, but after the right amount of random button pushing it seemed to work. However, IOS was not the worst: provisioning for Blackberry was even more tortuous than IOS, but luckily we can forget about that now!

author: Wilksey
author_rank: Super Contributor
timestamp: November 10, 2016, 09:02:09 pm
content: Yeah, I think I need to install VS 2015 community, it asks me to pay for Xamarin, but I think it's because i'm on 2012 professional.I did a fair bit of J2ME stuff, which was relatively easy, would run on several devices, Sony Ericsson, Nokia, etc.

author: kaz911
author_rank: Super Contributor
timestamp: November 10, 2016, 09:52:04 pm
content: Quote from: Wilksey on November 10, 2016, 09:02:09 pmDownload the new Free Visual Studio Community edition - even that supports Xamarin. And Xamarin has been running pretty fast after being gulped up by M$ - and the Annual Developer conference is next week - so guess we might be in for next big release.https://www.xamarin.com/compare-visual-studioAnd Xamarin DOES compile to native code on both Android, iOS & WinDowner Phones. You do need a Mac to compile iOS still ( i think) - but 99% of development can be done on the PC - even remote debugging on iOS i think. (Have not tried yet as I work on both Mac & PC every day)

author: Wilksey
author_rank: Super Contributor
timestamp: November 11, 2016, 11:11:39 am
content: Hi Kaz,Does VS run on MAC?I am wondering how you compile the iOS version on the MAC (if it needs OSX to compile) if VS is Windows only, I know the new VS code editor thingy for NET.Core or whatever they are calling it works cross platform.Cheers

author: kaz911
author_rank: Super Contributor
timestamp: November 11, 2016, 01:34:55 pm
content: Quote from: Wilksey on November 11, 2016, 11:11:39 amI don't think so - with Xamarin VS - you link your Mac to your PC - and then when you compile in VS - it starts the Mac Xamarin/XCode remotely and pass the results back. Very seamless. So I have an old Macbook Pro (very old 2010 17") - sitting in a corner - and I use that for my iOS compiler when developing on the PC. When I'm not using it from the PCthe Mac is my Music workstationI dont think the new VS cross platform does Xamarin yet - but maybe it will come on the 18-25th at the Developer conference.You can also run Xamarins own "Studio" App on both PC and Mac - but being used to VS I don't like Xamarin StudioWhat I did:1. Started doing Xamarin - found it overwhelming ...2. Started doing Xamarin Forms v1 (Easy way to do cross platform - forms are "cross platform UI" - but not heavily custom design oriented - but makes native looking UIs on all platforms)3. Then when I need it - I do special screens for special tasks - and plug them into my Forms app. But there you then need to do design on each target platformMany big app's are written with Xamarin - where one of the EE popular ones is iCircuit - the cross platform "Spice" simulator.But if you know C# - then I find it the only solution - and cost wise - the most attractiveI looked at the other ones - like RAD Studio etc - as I (apart from Basic) started developing for PC's in Pascal (Poly Pascal - then Borland Turbo Pascal) - which means after 30 years ... I'm still developing in languages Anders Hejlsberg started or made popular/k

author: Wilksey
author_rank: Super Contributor
timestamp: November 11, 2016, 04:28:47 pm
content: Ahh I see,Makes sense, well, i'm all installed, after a brain fart with the SDK, all seems well.The only thing I didn't figure out was if I develop an app for Android, what are the steps for porting that into iOS, I presume I have to create a new iOS project, import the files, and change the namespace from Android to something else (IOS?) I presume the same is true for Windows mobile etc also?Thanks

author: kaz911
author_rank: Super Contributor
timestamp: November 11, 2016, 06:19:08 pm
content: Quote from: Wilksey on November 11, 2016, 04:28:47 pmI would create both projects at the same time - I find that easiest- then used shared libraries for your business logic / separation from data / and then data in separate connections.But I do think some of the Xamarin University videos are "free to watch" - so start with watching them (Starter iOS, Starter Android - and I do think there is a multiplatform)/k

author: Wilksey
author_rank: Super Contributor
timestamp: November 11, 2016, 09:31:33 pm
content: Nice, thanks, i'll look out for the videos!