You are browsing the archive for Android.

Avatar of Scotty

by Scotty

Setting Up For Android Development with Oxygene

January 9, 2014 in Android, Cooper, Elements, Uncategorized, Visual Studio

The purpose of this article is to help you set up Oxygene ready to develop Android applications. It assumes you have already installed Oxygene, but will walk you through installing the Java and Android SDKs, as well as setting up a virtual Android device and configuring your physical device for development. If you have already been developing for Android using another platform or have already set these things up independently, you do not need to read this article.

Android is an operating system for devices such as mobile telephones and tablet computers developed by the Open Handset Alliance led by Google. Application development is focused on targeting the specialized Dalvik Virtual Machine (VM), which is a mobile-optimized VM similar to the Java VM. Oxygene ships with templates for creating Android projects, and produces both native Java JAR files and the Android APK file necessary for deployment to an Android device.

The Pre-Flight Check

Each time you create an Android project with Oxygene, it will do a ‘pre-flight check’ to ensure that it can locate the things it needs, notably the JDK and the Android SDK.

Java Pre-Flight Check

If you’ve installed them into custom locations and it fails to find them, this gives you an opportunity to specify the installation folders by selecting the “Manually Specify The JDK Path” link from the dialog.

Java SDK Paths

Java SDK

Oxygene requires version 6.0 or later of the Java Development Kit (JDK) to be installed. For Windows, we recommend installing the “x86″/”i586″ release of version 7 JDK.

If you have not yet installed the JDK, you can download it from here.

Installing the JDK simply involves downloading the installer and running it, accepting all the defaults.

Install JDK

Once the JDK is installed, click Retest on the Pre-Flight Check dialog. If all has gone well, the dialog should change to report that the Android SDK is missing.

Android SDK

To create Android applications, Oxygene requires the Android SDK to be installed, in addition to the JDK.

If the JDK is installed, but not the Android SDK, the Oxygene pre-flight check will report this.

Android Pre-Flight Check

Download The Android SDK

The Android SDK can be downloaded here.

For Windows, we recommend using the .exe installer available under the “SDK Tools Only” section that is displayed when you expand the “Download for Other Platforms” area of the SDK download page , as it will automatically register the Android SDK with the system so that Oxygene can find it.

Android SDK Download

NOTE: If you download the .zip version of the SDK and manually extract it, you will need to manually configure the path to the Android SDK in the IDE options, as described further down on this page.

NOTE: If the Android SDK installer complains that the JDK cannot be found, that may be because you have the x64 version of the JDK installed (see above). Simply install the x86 (i.e. 32-bit) as well to solve this problem.

Once you have downloaded the Android SDK Installer, run it and accept all the defaults.

Android SDK Installer

After installing the Android SDK, setup will automatically offer to launch the Android SDK Manager. Leave this checked.

Android SDK Installer Finished

The SDK Manager

In the SDK Manager, check to install the “Android SDK Platform-tools” and at least one API version (usually the newest) and click “Install Packages” to install.

Android SDK Manager

In the subsequent dialog you will need to accept any licenses that apply and press “Install” again.

Android SDK Manager License

You should periodically run the SDK Manager to check for any updates to the tools and platforms.

Android Virtual Devices

When the tools and platforms are all installed, you might want to create an Android emulator, also known as an Android Virtual Device or AVD. This will allow you to test your application, in case you don’t have an actual device (or don’t want to use your device for development).

AVD’s are created from the Android Virtual Device Manager, which is accessible from either the SDK Manager by choosing Tools – Manage AVDs or by starting the AVD Manager program directly or from the Oxygene Visual Studio tool bar.

Launch AVD Manager From Visual Studio

The AVD Manager

The first time you launch the AVD Manager there will be no configured AVD’s.

Android Virtual Device Manager

Create an AVD

To create a new AVD, click the “New” button. You will need to give the emulator a name. The AVD manager is pretty strict about what characters you can use in an AVD name, but will warn you when you use invalid characters.

Define a Device

The quickest way to set up an AVD is to emulate an actual device the DVD Manager already knows about. If you select the Device drop down, it will offer you a number of different Google devices it can emulate along with a set of generic devices.

AVD Device Selection

If one of these predefined devices match the type of device you are targeting, then simply select it from the list.

If none of the devices in the list match the device you wish to target, you can set up all the fields in the AVD manager manually. For a full list of settings check out the AVD Hardware Options Documentation.

Select an API

You will also need to select the API level for the Target field. You can choose any installed API level, for example Android 4.4 – API Level 19.

AVD Target Selection

Device Memory

When you choose a predefined device it will set the RAM setting for the AVD to match the actual device. In practice, this number may be too high to properly emulate and you could get a warning.

AVD Memory Warning

In this case, you will probably need to adjust the RAM setting to something more appropriate. (What’s appropriate will depend on the amount of memory in your development machine.)

Save The Device

Once the AVD is defined, click OK to save it. You will be shown a dialog confirming all the settings that will be used to create the AVD.

Save Setting Dialog

On clicking OK, the new AVD should now appear in the list of available AVD’s. If the AVD seems to be fully configured correctly, it will have a tick next to it in the list.

AVD in List

Test The Device

Once you have created an AVD, you can run it by selecting it in the list and clicking the “Start” button.

You will be presented with some launch options where you can simply click OK unless you need to change something.

AVD Launch Options

The AVD will then begin to start.

AVD Start Progress

After a few seconds, a blank emulator screen will appear. From this point, depending on the spec of your development machine, it could take several minutes for your device to appear in the emulator.

AVD In The Emualtor

Testing Your AVD Setup

Now you are ready to test your setup. Leave the device running. From within Oxygene, start a new Android Application Project.

New Android Project

This will create a very simple Android Template Application. Click the “Start” button on the Visual Studio tool bar and Oxygene will build your project and deploy it to the emulator where you should be able to see it running.

New Android Project Running In Emulator

Setting Up An Actual Device

AVD’s are great for testing your application on devices you don’t own. If you do however own a device, you can test your application right on the device itself. In many ways this is preferable to using an AVD, as you get to see exactly how it will run and perform.

Enable USB debugging on your device

Before you can debug an Android application on your device, you need to enable it for USB debugging.
On Android 4.0 and newer, you need to go into Developer Options and turn it on.

NOTE: On Android 4.2 and newer, Developer options are hidden by default. To make them available, go to Settings > About phone or Settings > About Tablet and tap Build Number seven times.

Once turned on (if necessary) you can find Developer options in Settings > Developer options.

Android 4.4 Developer Options

If your device is running Android 3.2 or older, you can find the Developer options under Settings > Applications > Development.

Install USB Drivers For the Device

In order to connect to an Android device to test your applications, you need to install the appropriate USB driver. This page on the Android Developers website provides links to the web sites for several original equipment manufacturers (OEMs), where you can download the appropriate USB driver for your device. However, this list is not exhaustive for all available Android-powered devices. The page also gives information on how to install the driver once you have it.

Running Your App On The Device

Once the USB driver is installed for your device, make sure the device is connected to your machine. From Oxygene you can then choose to debug your application on your device by selecting your device from the Crossbox area of the Visual Studio tool bar.

Select Android Device

The first time you run your application from within Oxygene on your device, a dialog will appear asking for permission.

You Are Ready To Go

That’s it. You are now set up and ready to begin developing Android applications using Oxygene.

Good Luck!

Avatar of marc

by marc

Android and “True Native” Compilers

August 12, 2013 in Android, Cooper, Elements

Here’s what Google has to say about using their NDK:

The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++. For certain types of apps, this can be helpful so you can reuse existing code libraries written in these languages, but most apps do not need the Android NDK.

Before downloading the NDK, you should understand that the NDK will not benefit most apps. As a developer, you need to balance its benefits against its drawbacks. Notably, using native code on Android generally does not result in a noticable [sic] performance improvement, but it always increases your app complexity. In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++ [or Pascal].

Typical good candidates for the NDK are self-contained, CPU-intensive operations that don’t allocate much memory, such as signal processing, physics simulation, and so on. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need.

At RemObjects, our philosophy has always been to support developers using the official tool chains and frameworks that are recommended by the platform vendor (especially now that in the 21st century these APIs have become so good, object-oriented and easy to work with, out of the box) – whether with our Oxygene compiler or our Data Abstract and RemObjects SDK library products, both of which support Android at the proper and recommended level: Dalvik.

Avatar of marc

by marc

Introducing the RemObjects “Beta” app for iOS and Android

June 26, 2013 in Android, Build System, Data Abstract, Elements, iOS, Uncategorized

We’re constantly trying to optimize the workflow for publishing and announcing beta releases. Oxygene has been on a weekly beta cycle for a long while now and we’re trying to get RO/DA onto a more regular (maybe bi-weekly-ish) cycle as well (i’ll be writing more about our upcoming plans for RO/DA over the next year or so, soon), and we want to make the process of publishing new beta builds easy for us, and the process of being notified about new beta builds easy for you.

As part of this, two changes have been made recently.

Firstly, if you have installed any beta build of a product post our May 2013 releases, our Everwood Update Check will now notify you not only of new release versions, but also of new beta builds being available – making it very likely you’ll be find out about new builds within 24 hours of actively using a beta product.

But we wanted to do more, and so we’ve started developing an app to keep the hard-core beta users amongst you even closer in the loop: Welcome to the “Beta” app.

“Beta” is a small app, available for iOS and Android on the respective app stores. The iOS version has been available for a couple of weeks now (i got it approved shortly before WWDC), and the Android version is live as of now. What does “Beta” do? Two things, really.

The most important thing, it will receive and show to you Push Notifications when new beta (or release) builds for your products are available. Are you anxiously awaiting the next Oxygene beta drop each friday afternoon? Your iPhone or your Android will now let you know!

So “Beta” will be useful even if you never ever run the app again, after the first time.

But you can also go into “Beta” at any time, to see the list of current beta and release products available to you, including a shiny “NEW” badge on builds shipped within the past two days. Over time, we might expand beta to show more info (such as to let you know whether a new build is covered by your current subscription or not, look at change logs, and more).

What does “Beta” look like? Here’s the iOS version:

(including a sneak peak at what it will look like on iOS 7), and here’s the Android version:

So where to get the app? You can get “Beta” on the iOS App Store and the Google Play store, respectively. In addition, we’ve also made full source for the app available on GitHub; of course it is written in 100% Oxygene, the client apps and the Push server.



Avatar of marc

by marc

Announcing Oxygene 6 and the new Oxygene for Cocoa

May 28, 2013 in .NET, Android, Cocoa, Elements, iOS, Java, Mac, Oxygene, Visual Studio

Hello everyone.

We are more than pleased to announce the release of Oxygene 6, the next major milestone of our Oxygene language. This new version includes a significant update to the existing “Oxygene for .NET” and “Oxygene for Java” editions, but – most excitingly – it also marks the first release version of our all-new Oxygene for Cocoa.

Oxygene for Cocoa is a brand-new edition of our Oxygene language, and it targets native Mac and iOS development with the Cocoa frameworks, using the same great language you already know and love from .NET and Java. We are very excited about Oxygene for Cocoa, and we think it will be a game-changer for how you create apps for Mac and iOS.

Oxygene for Cocoa is a very unique product, in that it is the only language (next to Apple’s own Objective-C) to truly natively target the Cocoa platform and the Objective-C runtime. It gives you access to all the great frameworks and libraries provided by the platform, lets you use all the native UI controls, and generates executables that are lean, mean and blazingly fast – and compiled directly for Intel x64 (Mac) or ARMv7 and ARMv7s (iOS).

Get Oxygene now

Support for all three platforms is available in the new Oxygene 6 package, which is a free update for all active subscribers who bought Oxygene form us since last August. It is available for new users at only $699 (again including all three platforms!), and individual platform support is also included in our Suite Subscriptions for .NET, Cocoa and Java, respectively.

Special renewal pricing is available for existing Oxygene for Java or Prism customers $499, as well as a special $599 cross-grade offer for any users of Embarcadero Delphi or of older Embarcadero Prism versions (XE2 and below).

We’re also for the first time ever introducing a new academic pricing for students, teachers and non-profit researchers, at an amazingly low $99.

And of course, as always, theres a free fully-functional 30-day trial version available, as well.

This is only the beginning

But we’re just getting started with this release and have many further exciting things planned for this year and beyond, including two minor updates for June and July, a significant “6.1” release in Fall, as well as several related products and technologies that will extend the Oxygene ecosystem that we’re not quite ready to talk about yet.

In the meantime, we hope you will enjoy the first release of Oxygene 6.0 and Oxygene for Cocoa – and we’re looking forward to hearing what Apps you will be building with it!

You can learn more about Oxygene at remobjects.com/oxygene and wiki.oxygenelanguage.com.

 

Yours,

marc hoffman
Chief Architect,
RemObjects Software

Data Abstract for Java Samples on Google Play

April 2, 2013 in Android, Data Abstract, Java

I’m happy to announce the availability of the DA SQL Sample – our first, but definitely not last, sample application that is available on Google Play. It is written in Java and powered by our Data Abstract for Java framework.

DA SQL Sample on Google Play

Now it is even easier for you to give the possibilities of Data Abstract for Java a try. Just install it on your device and try to fetch some data using SQL from our externally available PCTrade Sample Server. The sample is preconfigured to talk to http://remobjects.com:8099/bin, but you can change it on the Settings screen and direct the application to any locally accessible DA Sample Server. Make sure to also try the other available settings.
da-sql-android-initial-view-skinned
Other details about the usage and the concepts covered can be found at the sample’s wiki page.

More samples will be available in the near future. Meanwhile, please note that you can always download and install Data Abstract for Java and compile and run any sample manually. These samples can give you a good starting point in developing your own application with the Data Abstract for Java framework, be it for Android or any other Java-powered target platform.
da-sql-android-tablet-skinned

P.S. We have published two more Android samples lately.

Filters Sample shows how to use Dynamic Where and Dynamic Select features for obtaining data from the Data Abstract servers.
wiki page, Play link

Simple Sample shows basic Data Abstract functionality, including loading, changing and updating of data from and back to the Data Abstract servers.
wiki page, Play link

simple-sample-clients-list-framedframed_group-selected-framed-2

Install, try them ant tell us what you think!

Oxygene for Android Torch App

January 26, 2013 in Android, Cooper, Elements, Java

Brian Long made a great video on building an Android Torch App using Oxygene for Android. You can find it as part of RemObjects TV. The app he builds is a nice simple app, which makes the video easy to follow while also covering some concerns you may face in more complicated apps:

  • Permissions
  • Adding a new Activity
  • Using an Intent to move between activities
  • Creating a full screen Activity
  • Adding a Menu
  • Displaying Toast
  • Displaying a Dialog to get a user response

If you are new to Android Development with Oxygene, or maybe haven’t gotten into some of these topics yet then check out the video. You can also download the full source code for the app. Let us know what other Android related topics you would like to seen covered in future videos!

Oxygene on the Big Screen

January 4, 2013 in Android, Elements, iOS, Java, Mac, Metro, Windows, Windows Phone

Android powered Ouya ConsoleYou already know Oxygene is the best choice for mobile development – Oxygene for Java on Android, Oxygene for .NET for Windows Phone and the Windows RT Surface and the beta “Nougat” already providing great support for iOS development. But what if you want to develop on the big screen? Like that 50 plus inch TV in your front room?

Enter the Ouya, the Android powered game console for your TV. They just released their ODK (Ouya Development Kit), and since it is Android powered, it is perfectly supported by Oxygene for Java right out of the box. Oxygene for Java is a completely native Android development tool – there are no forced abstraction layers or additional run-times to get in your way or require updating when new variations or versions of the platform come out.

Red Ant Games has just announced they are using Oxygene for Java to move their Subject 33 to Ouya and Android mobile devices. Subject 33 is currently an Alpha prototype on Windows. They also have plans to support iOS and Mac with “Nougat”.

Oxygene Goes to School

December 13, 2012 in Android, Cooper, Elements, Java, Linux, Uncategorized

Dr. Norman Morrison recently published a wonderful series of Oxygene for Java tutorials on his “Pascal Programming for Schools” site, including some on Android development. He reports that students in his school are already using Oxygene for Java for their educational projects and are very excited about building Android applications as well.

Oxygene is great to use in educational settings. It holds true to the design paradigms of Object Pascal, which make it easily readable and discoverable. It doesn’t stop there though, but extends the language with great new language features frequently found in academic languages, like Tuples, Duck Typing and Aspect Oriented programming. The fact that it supports all common platforms of today is a real plus too.

Dr. Morrison also reports using Oxygene for Java to develop for his ARM-based Raspberry Pi, and includes some examples, too.

Adding Oxygene for Java to their curriculum has really energized both the department and the students while expanding their program!

Avatar of marc

by marc

“Native platform development is going to be the approach”

September 12, 2012 in Android, iOS, non-tech

Mark Zuckerberg about the new native Facbeook app (via Appleinsider, The Verge):

“Native [platform development] is going to be the approach that we go with for iOS and Android”. “We’re betting completely on it.”

Smart thinking, and much in line with our own philosophy on the matter.

He goes on:

“The biggest mistake we made as a company was betting too much on HTML5 instead of native [platforms],” and, “We burnt two years.”

Avatar of marc

by marc

Setting up your Nexus 7 for Development

July 30, 2012 in Android, Elements, Visual Studio, Windows

Today i tried setting up my new Nexus 7 to use for development with Oxygene for Java and our Data Abstract for Java BETA. As most of you probably know, i’m not a big Android developer myself, and this is my first encounter with a live device. Compared to iOS, there are quite a few more (and not obvious) steps necessary to get started, so i figured i’d write down what i had to do:

  • On the Nexus, go to “Setting|Developer options”, toggle the “ON/OFF” switch at the top to “ON” and enable the “USB debugging” option.

  • Plug your Nexus 7 in to USB. If you’re using Oxygene in VMware (say on a Mac), make sure go into the VM options and connect the “asus Nexus” USB device to the VM. (Carlo tells me there is a way to debug “remote” with the device attached Mac side, but that is fiddly. Maybe we’ll expose UI options to make that easy in a future update for Oxygene.)

  • On Windows, you need to install device drivers (not something i had to do for a long time ;). Oddly, this is a two-step process:

  • Go to the ASUS Website and download the driver that’s offered (choose “Android” as OS. Duh.). Run the installer. Oddly, this installs some stuff, but not the actual device driver. Instead, it places a .zip file with that driver in your Documents folder. Go and unzip that, you will need it in the next step.

  • Go to “Control Panel|Device Manager”. You should see an “Unsupported Device/Nexus” in the list. Right-click it and select “Update Driver”, choose to manually locate the driver, and browse to the extracted .zip from before.

  • With that, you should be set. If you now open an Android project in Visual Studio, you can go to the Project Properties, select the “Android” tab, and the Nexus should show up in the “Android Device” setting (as a cryptic hex number). If it doesn’t yet, clicking “Refresh” should do the trick.

  • There is no Step 7.

That’s it. Press “Start” and your Oxygene project should build and run on your Nexus.

 

 

Why did i get a Nexus 7? Good question. As we are getting deeper into Java and Android support (and with Oxygene for Java now being out almost three quarters of a year), i decided i need to get my hands dirty with some Android development myself in order to apply more of my trademark anal retentiveness to our Java and Android tool chain in both Oxygene and RO/DA. I figured the best way to do that was to get an actual device to play with.

So what do i think of the 7? It’s a nice device, for sure. I like it, probably more than i expected to, and i am starting to appreciate certain aspects of Android. There are some nice ideas there. That said, i don’t see the Nexus (or Android in general) replacing my iPad or iPhone anytime in the near future. No surprise there.