A non-programmers guide to programming - android

Okay so I am a very low level programmer and happy to admit it. I can write simple programs things like VB and python etc given the basic syntax. I want to write simple programs for android, for instance a calculator that handles feet and inches and a program that simply searches a database of products and tells me the details of them. Is there a simple solution where I can drag and drop some buttons and text boxes and execute code or do I have to learn the whole gui drawing code and start from scratch? If I do have to start from scratch is there a book out there that doesn't assume that I know any of the advanced coding techniques or do I have to learn the whole language and then learn the SDK? I want to be able to write a program quick and dirty, here are the variables here's the formula, do your thing...

Android App Inventor.
The problem with this approach is that you'll learn how to make apps in App Inventor, but not learn how to program Java nor how to program Android. It may be useful as a first stepping stone though, or if you really don't want to get your hands too dirty.

Android App Inventor can do exactly what you want. I've done something similar with it.
One month and a half ago, it took some of my students (and some other random people) about two weeks to get the initial invite (once they had put themselves on the general waiting list). Since the form for the waiting list is still in effect, I assume it will take around the same waiting time in your case, or may be even less.
A couple of caveats thought: You need an Android phone to run your 'Android App Inventor' App (it won't run in the emulator). Android App Inventor doesn't give you access to the generated code (they have no plans to, besides they're not using java for the generated code anyway). App Inventor won't let you publish on the Market (although, they do have plans to add that capability, for now if you want your friends to install your app, it can give you a QRcode for it, or give you the apk file to share with them).
While you're waiting for your invite, I'd suggest you try out Android Scripting
http://code.google.com/p/android-scripting/
Scan the QRcode on that page (it's not on the Market yet). Install the SL4A app. Once SL4A is running, press on the menu key > select 'Add' > select Python. Once that's running, I recommend you run the test.py to see what kind of GUI intents can be launched directly from your phone python shell. The SL4A project is still very much alpha quality, but I'd say it's worth playing around with (especially in Python, since Python seems to be currently the most mature scripting environment supported on there, it actually supports a zillion other scripting languages).
Another thing you can do, from the Market this time, is to download the 'AndroidShell Lite' app. run the app, press the 'Local Console' button, and play around with that. I suspect that AndroidShell is using a version of the SL4A, but unlike SLA4, it can not be run in the emulator, the code doesn't seem to be open source, it doesn't support python (only beanshell which is just as easy actually), but it has much better documentation at least. That's why I'm recommending that you try out both 'AndroidShell Lite' and SL4A. Each has different strengths.

I believe App Inventor is what you are looking for. It is not designed for complex apps but can be helpfull for simple apps.
https://www.google.com/accounts/ServiceLogin?service=youngandroid&passive=true&nui=1&continue=http://appinventor.googlelabs.com/ode/Ya.html&followup=http://appinventor.googlelabs.com/ode/Ya.html
regards.

I will suggest you do the following:
1. Improve your JAVA programming skill. Reading material: "Think In Java"
2. Improve basic Android programming skill: any entry level android book
Make sure when you go through the material,
do your best to design and implement some useful projects, and publish to the market if possible.

Related

Advice on the best way to go about developing an app for Android and iOS as first project

Sorry if the title wording is not clear enough. I need to deploy a very simple app on Android and iOS for a partner company (app does not need to be in App Store or Google Play) to control some machinery via bluetooth. Interface needs to be very basic and only contain a couple of buttons and some text labels that display some information (and be able to read a QR code).
We are not a mobile development company, thus I don't have any experience building apps like this, but the required functionality seems simple enough to at least look into what needs to be done.
Now, the problem is that I only know C/C++ and Python (moderate experience with the Qt framework) and am not really willing to learn both Java and Swift. I might consider learning Swift specifically for a simple project like this, seeing as iOS development is very much tied to their platform, but Java is out of the question. I've looked around and there seems to be a way to write both of them in Python and deploy to each platform, but something tells me it's not really worth the incredible amount of problems that could arise. I need your help with some advice on how to handle this project:
Can a cross-platform app be developed with python(or C/C++) and deployed to iOS and Android (thus halving the overall development time) whilst keeping a sufficiently tidy aspect and bluetooth communication?
If not, can I develop an Android app using C/C++ or Python without immense hurdles? I'd prefer Qt as i'm already familiar with the framework, but i suppose anything does it.
When developing an Android app under point 2, is it possible to see how the app looks like without installing it on the phone for every change in code?
Sorry if the post is too long, am really curios how difficult would a task like this be. I dont want to waste my time learning 2 new languages for just this project nor do i want to end up delaying the partner company with beginner problems caused by my scarce knowledge of a new language.
I really wouldn't suggest cross platform for this kind of project. The bluetooth stacks and APIs are going to be tremendously different, minimizing ability to code share. The UI stacks are completely different. Really using anything but the native tools on iOS can be particularly tricky. Python in particular is hard, because its not meant to interact with either platform. C would be easier, as both Java (via JNI) and Swift (via objective C to C bridges) can call C code. However the UI layers of the two are so different that it would only be useful for business logic, I would still recommend writing the UI in the native platforms.
If you were going to try and do cross platform, I'd suggest react native and javascript, merely because it's the most mature of the cross platform products. That said, their bluetooth stack is likely non-existant or poorly developed because its not the type of thing used by many of the type of apps that choose react native, so you'll likely have to dive into the deep end and learn how to make modules.
Given that this is going to be a company specific app not on an app store- do you actually need to support both OSes? Or can it be done on company devices of a single type? Pushing back on that product requirement might be your best bet.

How to open my Android native application with Xamarin.forms?

I've been developing an Android application with Android Studio and now I need to be able to open it with Xamarin.forms in Visual Studio (it's a task that my teacher gave me, and it's because a classmate has been creating the iOS version and now we will combine them into one project).
I have to say that I'm pretty much a noob and been looking a few tutorials that talk about Dependency Service and other stuff, but don't seem to quite cover what I'm looking for (or, at least, not clearly enough).
If you have a precise video that explains simply how to do this, I would be grateful if you share it with me.
I thank you for your time and wish you a great day :)
It is impossible at even now in current version of Visual Srudio .
Every file in Xamain is different with Native Android . The Java code can not be directly copyed to use in Xamarin , you should translate them to C#.
Having a look at this document: Porting Java to C# for Xamarin.Android .
There are two ways to port Java code to C#. The first way is to port the code manually. ..The second porting methodology is to try and automate the process by using a code converter...There is often a non-trivial amount of work involved with bootstrapping an automated code conversion tool, and this may prove to be a barrier to use. In many cases, it may be simpler and easier to port Java to C# by hand.

Python - Does Kivy implements activities in the Android apps?

As we all know, when developing an Android app in native Java, we use activities. I was wondering that, in developing Android apps in Python(with Kivy), does Kivy implements activities for the apps in itself or not? because I don't see any activity implementation on the sample codes.
If it doesn't implement activities, Do we lose performance or any functionality in the application compared to coding in native Java?
Simply put, you can use Activities (starting them using pyjnius), but not really define them, at least, it's not usually the way one work with kivy.
Kivy doesn't adjust its way of working for targetted platform, it uses its own systems, and make them work there. For what i know the advantages of separating Activities on android is just a way to make your code more neatly organized, and doesn't imply performance changes. It can allow you to start your app in various ways (from a share, for example) but you can do that with p4a/buildozer too, by dispatching messages about the intent, if you need to. With kivy, you'll organise your code like you would do for any python project, using modules.
Kivy is a great tool for developing Android Apps. The best advantage of using Kivy is that it is cross platform and the same project can be used to publish apps on mutti-platforms.
However , it has some performance related disadvantages(as do most cross-platform tools like unity , cocos etc). If you're developing only for Android , I'd suggest taking a look into development tools which use Java. This will help create a smaller APK file which in turn helps in better user retention.
I guess you are real loyal fan of Python, but I have to tell you about its advantage and disadvantage.
Advantages
Pure python and its almightiness is in your hand.
Relatively simple to deploy with buildozer without any need to dive too deep into the details of particular platform.
You can run your app on desktop also, so there is no need to install some extra emulators/VMs to get it work
Disadvantages
Not that much information in Internet, even on stackoverflow
Pretty messy documentation
No obvious way to test the application
Not obvious machanisms of placing widgets, especially in built in layouts, which causes situations like: you want place widget in the center of it's parent, but kivy places it anywhere but not where you want it to be.
Official examples are quite ugly, so you may get false vision of how your application could look like.

Python for IOS or Android

I have been looking at the different packages for python on android and IOS as i am going to be upgrading my phone soon.
However, i dont know which OS to go with. For android they have the SL4A package, but for IOS they have their equivilent. However, im stuck on which to go for. Does anyone have any suggestions for this?
I know its kind of a stupid question, however im just getting into mobile development since they allowed scripting languages on the mobile platform.
The python support for Android is pretty good, but still under development. You can do things that a scripting language can but not the stuff that Python as a OO language can.
Example:- When you go through the api reference here, you can see that one can write scripts to do basic to complex tasks, but, in a restrictive way. You can never build full blown apps, and even if you do, it will always be slow because the SLA4 is just another layer on top of few other layers in the Android hierarchy. There have been a lot of fun stuff that has been done using Python scripting, example: http://www.wired.com/gadgetlab/2010/07/nexus-one-phone-rides-a-rocket-up-28000-feet/#ixzz0v7LFT7ay (A bit over-board and crazy, but awesome nonetheless.)
I don't have much experience on an IPhone to pass on such comments. But, an IPhone is expensive. You can always get a used Nexus phone and do all kinds of Python hacking/scripting. All depends on your budget and your need.
That is all.
I had been on the lookut for Python on iOS for sometime. About 2-months ago, one one released to the iTunes app store -- http://pythonforios.com/ and it is fantastic! It includes the complete set of Python 2.7.2 documentation -- which alone is worth the $3 price.
It's a bit of a challenge to code any serious apps (which I suspect is the result of the developer having to comply w/ Apple's app guidelines), but it is a perfect place to test ideas from a train or airport (when you are without a laptop).
1 caveat -- I've only tried it on an iPad. It could be a bit cramped screen real-estate on an iphone.
Pythonista is an excellent alternative for the iOS platform - here's a nice article on it. And this one details how you can achieve workflow automation on the iPAD.

An approach to porting a project to another platform

I am an intern at a company trying to push an android and iPhone out out within the next 5 months. Today, I received information about my first "real" assignment which will entail porting the iPhone App to the Android platform. Here's my problem though: I've never seen a single line of Objective C code and I only just started programming in Java and for Android devices last wednesday.
So how do I go about porting an application? Where do I start? How do I best organize myself and get an overview of which tasks to complete and when to start working on them ?
tldr; How do I port an application to another platform?
Word porting means in effect creating an application on another platform (in another language if needed) that maintains the same functionality. As iOS and Android use different languages and internally very much different operating model, you cannot simply take iPhone code and translate it line-by-line into Android.
What you do need to do is analyse the functionality of the iPhone app and create an app for Android that will perform the same functionality. Do not approach this as a direct "porting" project, but rather as a new development project. You may be able to translate some business logic one-for-one - but anything related to the user interface (and, most likely, to any back-end server communication if you have any) will need to be written from scratch. You may encounter certain things that are present in an iPhone but are not supported at all in Android, or are very complicated to implement, so try to think how to substitute them with whatever Android does support.
The biggest problem you'll encounter with Android is the multitude of screen sizes and versions, each of which may behave differently and support different things. I suggest you start from the beginning and do one screen at a time, adding functionality step-by-step until you get the desired app.
5 months is a long enough period of time to complete the job for almost any app. Good luck!
P.S. I have gone through this exercise myself: having an iPhone app I had to "port" it to android platform. Using the approach I described, it took me about 2 months to complete the android app, which initially took about 3 months to create on an iPhone platform.

Categories

Resources