Monday, February 17, 2014

This is a bit off mobile topic but I think it's a very important issue that can be hard to solve for everyone that is building flex apps for other locale different from the common ones.Since version 3.2 of ArcGIS for Flex, Portuguese (pt_PT) locale is supported, but if you change your Flex project to Portuguese you will get compilation errors. This article will guide you on how to overcome this problem with any language.

When you want to change the locale of your flex app, the first step is going to the project properties (right mouse click on your project's root). In Flex Compiler you will find in the arguments box:

This Esri’s document also helps out on how to copy an existing locale, giving it a new name, but if you want to create a whole new localization files, let’s say, Portuguese, you will have to translate the copied files.

3.In my case I will copy the existing pt_BR to a new pt_PT because the language is quite similar. This way I won’t have much work on translating the files.

Type copylocale pt_BR pt_PT. This will create localization files for pt_PT but with the same words as pt_BR.

If you want to copy, for example, from English to Hungarian you should type copylocale en_US hu_HU.

4.In the file explorer go to C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\frameworks\locale and you will find the new created folder pt_PT. If you don’t find it this could mean that you are not running command line with administration privileges.

5.Back to Flash Builder, in the project’s properties argument box, set the locale to pt_PT, like this

6. Clean and compile the project. The error will go away and the localization strings will be set to the copied locale. Check, for instance, map tool tips and month names in calendar controls.

The next step is to translate the localization files with the correct words.

1.Go back to file explorer. In C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\frameworks\locale\pt_PT you will find ten .swc files. These files are where you will find localization strings.

2.In order to access and change this files you will have to extract, or unzip, every file with a normal packaging software like WinZip or 7Zip. You will probably get a “Access denied” error when unzipping the files, so copy every file to another location like your desktop.

3.Inside each extracted .swc you will find the folder \locale\pt_PT. Inside of this folder there are the localization strings.

4.With a lite text editor like Notepad++ edit each file to translate its string without changing the file format

5.After translating all the files you need to package the files again. Many posts on the web and even Adobe’s documentation point out to running a flex command line torecreate the .swc files but I couldn’t put it to work. I always got errors. So what I did was opening the original package files, one by one, with the packaging software and dragged and dropped the translated files back to its sources. Pay special attention to copy the files to the same location inside the package without changing the .swc original file structure.

6.The final step is to copy the translated .swc files back to C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\frameworks\ locale\pt_PT.

Wednesday, December 11, 2013

One common question when implementing and designing a full field collection solution is, what type of licensing do I need in order to use ArcGIS for Windows Mobile (AGM).

In the early versions of AGM you would only get authorization with an ArcGIS for Server (AGS) Advanced Enterprise license, and you could only synchronize your data, between field and office, with a service publish on AGS. But starting with 10.1 if you have ArcGIS for Desktop you will also get one AGM license and you are able to synchronize your data with local Geodatabases.

Having said that, you can install, collect and synchronize your field data with your office data having a Desktop Licence or a Server Licence. Conditions following.

ArcGIS for Desktop

AGM is available with Basic, Standard and Advance licensing;

You get one mobile deployment for each desktop license;

If you need more mobile deployments you can purchase additional packs of 5 or 50 deployments;

You will be able to synchronize your field data with local Geodatabases with your ArcGIS Desktop software.

ArcGIS for Server

With an Advanced Enterprise license you will get unlimited mobile deployments and you will be able to create mobile capable services. This services are responsible for the synchronization of your data between your mobile and server;

With Advanced Workgroup and Standard Enterprise licensing you server is mobile ready but if you want to use AGM you will have to buy mobile deployment packs of 5 or 50;

The remaining Server licensing do not allow the use of AGM.

It is my understanding that the mobile deployment is the equivalent of field workers you have deployed on the field at one specific time or project. As an example, if you have one ArcGIS for Desktop license, you can have only one member of your team collecting and synchronizing data. If you want to have a team of 8 field workers collecting data, you will have to buy two packs of 5 mobile deployments.

Monday, November 4, 2013

Starting from Windows 8 the connection to the GPS receiver is no longer supported by COM Ports. Instead Microsoft developed what they call 'Windows Sensor and Location Platform'. This platform eases the connection to the many location techniques that are available on the device like Wi-Fi triangulation, IP address or GPS device. This is a quite new platform and a some hardware vendors support both modes.

O ArcGIS Mobile 10.2 does no yet support this functionality which will only be available on the second quarter of 2014.

I have tested option 2 on two devices and it works fine. This extension does not work with ArcGIS Mobile 10.2.

This extension comes with a readme file that states 'Copy files inside ReleaseAssemblies Folder into C:\ProgramData\ESRI\ArcGIS Mobile\Extensions. ArcGIS for Windows Mobile tablet application will use Location API instead of COM port.'

If you don't have this path on your device, just create it and copy the files. Don't forget to restart ArcGIS Mobile App. Then go the GPS Settings and Status and check the Windows Location API Settings.

Create a new Flex Project in File -> New -> Flex ProjectType a project name like ArcGISFlexDesktop and select Desktop (run in Adobe AIR)

For the next options go with the default.Now that the project is created, expand folder src - (default package) and open the file ArcGISFlexDesktop.mxml. Also, on the FlexViewer Project, expand folder src - (default package) and open the file index.mxml

As you can see from the above image, the desktop application entry point is the s:WindowedApplication. As for the web application it’s the s:Application. So the first action is to copy the contents inside the s:Application tag, properties included, and paste them inside the s:WindowedApplication.

Next, copy the selected files (see image below) from the FlexViewer project to the ArcGISFlexDesktop project. The project structure must be the same for both projects.

The next step is to add all the modules to the project. Go to Project - Properties and then in the ArcGISFlexDesktop Properties dialog select Flex Modules and add the following mandatory widgets.

HeaderControllerWidget.mxml

InfoPopupWidget.mxml

WidgetContainerWidget.mxml

OverviewMapWidget.mxml

NavigationWidget.mxml

MapSwitcherWidget.mxml

I also added BookmarksWidget.mxml and QueryWidget.mxml but you can add all.

Finally you must copy the compiler arguments from the FlexViewer project to the ArcGISFlexDesktop project. Right click on the FlexViewer project and select Properties. Then go to the Flex Compiler tab and copy the text from the Addicional compiler arguments box. Paste this text into the same box on the ArcGISFlexDesktop project.

You’r all done! Press the run button and there you have it! An ArcGIS Flex AIR application.

To my surprise, porting a web Flex app to a Desktop AIR app was so easy that some questions came up. Why did Esri launch an ArcGIS runtime for Silverlight (WPF) and for Java but not for Flex. There are not even news or plans.The ArcGIS runtime is intended to work in online and offline modes. For the offline mode map tile packages are used, so the app needs to access the local file system. Flex RIA has the capabilities to access local file system so I have no clue on why there are no plans on making an ArcGIS Runtime based on Flex.Download the installer of ArcGIS Flex Viewer for Desktop

Wednesday, December 5, 2012

On my previous post I wrote on how to create an iOS relase build for ad-hoc distribution. But soon after I created and published a release build for a cliente, I was confronted with an aditional challenge. What if I want to add additional devices to the distribution package?

If you do a small search on the web and forums the news you’ll get is that you have to go through the complete packaging process again and again for each new device.

The news I have is: YOU DON’T!! What you have to do is update the existing mobile provisioning profile with the new device’s ID and distribute it along side with the original application's package.

Associate the new device to the application’s distribution license

In the row that corresponds to the distribution license press Edit on the right and then select Modify

In the Devices Section you should see the newly added. Select it, and all the devices you wish to assign to the license

Submit Press when finished

After you press Submit the license status may be in Process. If this happens press the F5 key to refresh the page. The status should switch to Active.

Press the Download button to download the license file. The file name is [LicenceFileName].mobileprovision

Distribute your licence and app files

There are two ways you can send the application and licence files to your users.

One is by email. Then the user can install both files with iTunes. First the licence file and then synchronize the application file.

The other way is to publish both files on a web server just like on this previous post.

In order to go with the second option, follow these steps.

Go to this previous post and follow the same last steps on how to configure the webpage

Then on the index.html file you must add also a link to the licence. The complete code is as follows

<body style="height: 100%;">

<ul>

<li>

<a href="http://[ServerName]/[LicenceFileName].mobileprovision">

Download Licence</a>

</li>

<li>

<a href="itms-services://?action=download-manifest&url=

http://[ServerName]/[AppFileName].plist">

Download Application</a>

</li>

</ul>

</body>

You also must add a new MIME type for the licence file

.mobileprovisionapplication/octet-stream

This web page will have two links. One for the licence file and the other for the application installation package.

The application package is the same that was generated on this previous post.

Installing the application in new devices

To install the application, you must first install the licence and then the application. Send the link of the webpage by email.

To install the licence you must click on the Download Licence link

Install the licence clicking on Install

After the licence is installed. Press OK.

note: If when downloading the certificate an error message appears, this can mean that the device is not authorized to use this application, that is, the UDID of this device is not associated with the licence

Return to the web page and click Download Application. This will initiate the download and installation of the application.

And you’re done. If you need to add more devices, just repeat the process. At the end, on the webpage, replace only the licence file (.mobileprovisioning file).

Wednesday, October 24, 2012

Making a release build for the app store or for distributing an app in your company is always a pain in the neck. Apple insists on changing the process for each version of XCode, changing the rules, changing licences, once or twice a year. There are numerous articles and blog post on the web that will try to help you build a release version of your app. I say try because it’s hard to find an up-to-date article that will fit your XCode and Mac OS version.

So, this is my contribution to the confusion of articles on making a release build for an iOS App.

On the 29th of August of 2012 with XCode 4.4, Mac OS Lion 10.7.4 and iOS 5 these are the steps on making a release build for Ad-Hoc distribution of an iOS app.

Register Devices

The devices to which you intent to install your app need to be registered in your account.

Click on iOS Provisioning Portal

Click on Devices and the on Add Devices

To add a Device you need any name and a Device ID. To get the Device ID you have to

Connect your device to your Mac

Open Itunes

On the summary page

In there you will see the Serial Number of your device

Click on the Serial Number and you will see the Device ID

Click command-c (Mac) or ctrl-c (Windows) to copy it to the clip board. You can then paste it on the iOS Provisioning Portal or send it by email to whoever is registering your device

Give a name to the device and the Device ID and click Submi. You can register up to 100 devices.

Create an App ID

Your app must have an AppID

Click App IDs. On the tab Manage click New App ID.

Write a intuitive name for your App ID in the Description

Select your Team ID. You should have one from your Apple Developer License

The Bundle Identifier must be the same as in your Project. Go to XCode to get it

Submit

Create the Distribution Provisioning Profile

On the same page click on Provisioning on the left, then the Distribution tab and then New Profile button

Select Ad Hoc

Choose a intuitive profile name

Click New Profile button

After submitting the profile it will be available in the profiles page. Once it is active, should take a few seconds (must refresh the page), you can download it.

After downloading the profile you must install it on XCode. You can drag and drop the file to your XCode icon

After this the XCode’s Organizer will open and you can check for the profile

Create the Distribution Archive

Now back to XCode. Select the Project and the info tab.

In the configuration Table add a new configuration. Click the plus sign to duplicate the Release configuration

Name the new configuration Ad-Hoc. It will look like this at the end.

Now, still in the Project view, go to Build Setting tab.

The Ad-Hoc configuration is in the Code Signing Identity table.

In the row named Ad-Hoc and sub-row named Any iOS SDK click on the AdHocTestApp row to select a profile

And select the profile you created on the Apple Developer Portal

Next, click on the Scheme selection button on the top left

and select Edit Scheme

Select Archive on the left.

Select the Ad-Hoc Build Configuration and click Ok

You are now all set up ( Finally!!! ) to create the distribuition package.

Click on the Scheme selection button and select iOS Device

Build you App

After it finishes select Archive

The Organizer window will open after the archiving finishes

Now click on Distribute

Select Save for Enterprise or Ad-Hoc Deployment

On the next window choose your Ad-Hoc profile and click next.

Select where you want to save the .ipa package, I chose the desktop.

At this point you have two choices regarding Save for Enterprise Distribution check box

Install the app through iTunes. Leave it uncheked

Download and Install the app on the iPhone through a webpage. Check it.

If you choose the first option the file AdHocTestApp.ipa will be created on the desktop and you can now drag and drop it to you iTunes and then synchronize the app. The Profile you created is embedded in .ipa package. And you're done! Congratulations!!

Or not... If you choose the second option there are still a few more steps. So keep reading.

Choose a name for the package

Check the Save for Enterprise Distribution option

Type the URL of the location of the .ipa in your server

Add a title

I haven’t tested the subtitle and image URLs yet.

Click save.

This will generate two files in your desktop

AdHocTestApp.ipa

AdHocTestApp.plist

You have to copy this files to your server to the location you specified above

The next step will be creating a web page form which you can donwload the app. This is the simplified version.