Android Send/Receive data with Arduino using Bluetooth – Part 2

Harry's Developer Blog

To get things moving along quickly I am going to use the same activity that I used in the last blog to find my paired devices. This can be found here. Only one thing will change and that is the activity name. Call it DeviceListActivity, as it is no longer the main activity.

Also make sure that you update your permissions in the manifest to allow bluetooth (and the DeviceListActivity name if you didn’t start a new project from part 1).

Now on to the new stuff! We are making an activity that will allow us to turn on/off an LED on the Arduino as well as receive data via bluetooth. When finished it will look like the image below. Screenshot_2014-04-12-01-40-22 As we are sending and receiving data this time through Bluetooth rather than just sending there are a few more things to take care of.

First of all is…

View original post 490 more words

Advertisements

Anrdroid Send/Receive Data With Arduino Via Bluetooth – Part 1

Harry's Developer Blog

In the last three posts I went through the basic steps to send data from an Android device to an Arduino using a bluetooth serial module. That was fun and all but it would be better if the Arduino could send data back to the Android device. With functionality like that there a lot more plausible uses for the technology. For this example I am going to go through the steps to make a 4 channel voltage logger but with a few minor changes this could be used to send/receive practically anything.

All files used are available on GitHub here.

Like last time, lets get the Arduino stuff out of the way first. For this project I have made a simple sketch and circuit that takes four analog inputs A0-A3 and then converts the values to 2dp float voltage values. The values are then displayed on the LCD screen…

View original post 454 more words

Creating OSM Offline tiles using Maperitive

MapIt offline extension is allowing to use prepared earlier basemaps when there is no Internet connection available. Please follow this guide to create .mbtiles file which you can then use as an alternative base map.

There is number of commercial application allowing you to create such a file, but in this article we will focus on the open source solution and the Maperitive software.

You can download the application from here. You need to unzip the file, and run Maperitive.exe. Maperitive may take a while to start up, just wait.

Linux or Mac OS X users can follow this guide to install the software.

The full documentation for the Maperitive is available here, however following this sample guide you will be able to create the offline map just in few minutes.

1. Open the software and zoom to the area of your choice. You can add more web maps (e.g. Open See Map if required)

1

2. Set Geometry Bounds for your area

2

3. Zoom-out slightly to see the selected area – you can modify the rectangle if you wish.

3

4. Download OSM data for selected area.

4

5. Wait until the OSM data will be downloaded from the server:

5

6. Ones the data is downloaded remove Web map (OSM Mapnik) from the map viewer – this is not necessary, but will speed up the generation of the tiles.

6

7. If you like Hill Shading – you can apply the preset template. The necessary high data will be automatically downloaded.

7

8

8. If you need you can add contours to your map as well.

1

9. Ones you are happy with the map, you can zoom-in or pan around to check the details you need to generate the offline tiles. This operation may take a while and depends from various factors like the performance of the PC, selected zoom-levels etc.

10

You can read more about the consequences of the zoom-level selected here.

I would strongly recommend that you do not use zoom levels above 17 when creating offline tiles. Usually level 16 or 17 is enough for most activities.

When you are happy with all the map settings please follow this guide to generate the mbtiles file.

Basically you need to run a command like:

generate-mbtiles minzoom=0 maxzoom=17

From my our personal experience is better that you generate more smaller files than one big one for huge area, however it’s entirely up to you and you may prefer other options.

The generated file will be located in the Tiles folder, you can rename it before copying it over to device SD card:

13

14

10. The offline map can be set as default using the extension and used without Internet connection.

Screenshot_2015-02-14-03-04-18 Screenshot_2015-02-14-02-58-52

Screenshot_2015-02-14-03-00-31

Oracle spatial and the web mercator spatial reference system

Vishful thinking...

We have been attempting to streamline the way we store and process spatial data in Oracle. Normally, we would create our spatial tables as FeatureClasses from ArcCatalog and create plain old Oracle tables for our business/attribute data that would be joined with the spatial data in the FeatureClasses through a shared key field to create a SDE spatial view. This works just fine, but there are some drawbacks to this approach

  • SDE creates unnecessary fields on the FeatureClass table in Oracle, like the field cad annotation that just don’t need to be there.
  • Creating FeatureClasses manually from ArcCatalog is a process that cannot be automated as a part of the build process. Ideally, we like to execute a command from our build scripts that will delete our entire model from the database and run another command to recreate the entire model to start off with a clean slate for testing our…

View original post 982 more words

TileCutter update – With support for OSM and WMS map services

Vishful thinking...

I just added support for creating MBTiles caches for WMS map services and also to download OSM tiles into the MBTiles format. MBTiles cache for WMS map services would improve map rendering performance, but why did i add support for OSM tile sets? Well, they will come in handy for disconnected/offline use cases. So, here are some usage examples

ArcGIS Dynamic Map Service:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:LocalCacheags.s3db” -t=agsd -m=”http://server.arcgisonline.com/ArcGIS/rest/services/I3_Imagery_Prime_World_2D/MapServer”

WMS Map Service 1.1.1:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:LocalCachewms111.s3db” -t=wms1.1.1 -m=”http://sampleserver1-350487546.us-east-1.elb.amazonaws.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer”

WMS Map Service 1.3.0:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:LocalCachewms130.s3db” -t=wms1.3.0 -m=”http://sampleserver1-350487546.us-east-1.elb.amazonaws.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer”

OSM:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:LocalCacheosm.s3db” -t=osm -m=”http://tile.openstreetmap.org”

And always just type “TileCutter -h” for usage information.

Want to customize the parameters with which the maps are being generated? Just use the “-s” command line option ans specify the setting in a…

View original post 109 more words

TileCutter – A small utility to generate tile cache in the MBTiles format from ArcGIS Dynamic Map Services

Vishful thinking...

Thought I would share a little utility I had written up to generate tile caches in the MBTiles format for ArcGIS Dynamic Map Services. The MBTiles cache format is very simple and makes moving caches between machines very easy since you just have to transfer one file instead of the thousands of files that need to be copied for normal tile caches. The TileCutter is a console utility and accepts the scale range and the extent in latitude/longitude for which the cache should be generated. It also takes a few other options listed below.

Options: -h, --help Show this message and exits -m, --mapservice=VALUE Url of the ArcGIS Dynamic Map Service to be cached -o, --output=VALUE Location on disk where the tile cache will be stored -z, --minz=VALUE Minimum zoom scale at which to begin caching -Z, --maxz=VALUE Maximum zoom scale at which to end caching -x, --minx=VALUE Minimum X…

View original post 239 more words

MapPad – Simple mapping solution for Android devices

Hi guys, check it out – it’s my first app for android devices. I am looking for some comments and feedback, if you work in real estate, forestry, agriculture business – it’s going to help you out. At the moment English, Polish , Portuguese and Italian localisations are available.

I am looking forward to include other languages and need people who can speak particularly Spanish, Chinese, Russian – whatever :).

Visit MapPad website to get more details…