Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - menion

Pages: 1 ... 10 11 [12]
166
Developers / [DEV] - (DEPRECATED) show points on map
« on: November 16, 2010, 07:14:40 »
Simple solution for using Locus as external viewer of points from other applications!

6.7.2011 - This method is DEPRECATED - use new API instead - viewtopic.php?f=29&t=767

[s:ounfezv9]19.4.2011 - New update of calling method - version 2

working for version >= 1.5.3

simple code example says more then few pages of words (use commentary as helping solution)

Code: [Select]
private void callLocus() {
ByteArrayOutputStream baos = null;
DataOutputStream dos = null;
try {
   baos = new ByteArrayOutputStream();
   dos = new DataOutputStream(baos);

   // version
   dos.writeInt(2);

   // write objects names
   dos.writeUTF("Points from my application");
   
   // write category count - here I write three categories. Categories are defined as
                    // array of points that share same map icon!
   dos.writeInt(3);
   
   // write categories
   writeCategory(dos);
   writeCategory(dos);
   writeCategory(dos);
   
   // flush data to output stream
   dos.flush();
   
   // create intent with right calling method
   Intent intent = new Intent();
   intent.setAction(Intent.ACTION_VIEW);
   intent.setData(Uri.parse("menion.points:extraDataSomeName"));
 
   // here put data into intent
   intent.putExtra("extraDataSomeName", baos.toByteArray());

   // finally start activity
   startActivity(intent);
} catch (Exception e) {
   Log.e(TAG, "callLocus()", e);
} finally {
try {
if (baos != null) {
baos.close();
baos = null;
}
if (dos != null) {
dos .close();
dos = null;
}
} catch (Exception e) {
// catch not needed
}
}
}

private void writeCategory(DataOutputStream dos) {
try {
// convert resource to byte array
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon_gc_wherigo);
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos2);
byte[] image = baos2.toByteArray();
baos2.close();

// write image data or size '0' and no data if use default image of Locus (currently just red dot)
                       - so if you want write image use this
                        dos.writeInt(image.length); // image size
dos.write(image); // image data
                        - and if you don't want use only this
                        dos.writeInt(0);

// write all points now
int pointCount = 1000;
dos.writeInt(pointCount);
for (int i = 0; i < pointCount; i++) {
// write item name
dos.writeUTF("name_" + (i + 1));
// write item description
dos.writeUTF("some description with <html>tags</html>!");
// extra values (describe below - optional)
dos.writeUTF("");
// write latitude
dos.writeDouble(50.0 + 0.01 * i);
// write longitude
dos.writeDouble(14.0 + 0.01 * i);
}
} catch (Exception e) {
   Log.e(TAG, "writeCategory()", e);
}
}

Extra values written in code can be used for extending possibilities which user can do with point

currently supported:
    Call-back - "intent;ButtonName;com.super.application;com.super.application.Main;returnData;someStringData"
      intent - just identifier
        ButtonName - String that shows on button
        com.super.application - The name of the package that the component exists in
        com.super.application.Main - The name of the class inside of com.super.application that implements the component.
        returnData - String uder which data will be stored. Can be retrieved by String data = getIntent.getStringExtra("returnData");
        someStringData - data stored in intent at returnData StringExtra place
      [/list]
      [/list]

      Actual application that use this feature
      c:geo[/s:ounfezv9]

      167
      Testing / [APP] - version 0.4.0 RC
      « on: November 04, 2010, 08:47:03 »
      Hi to all,
        after two days of work, I completely transcribed methods for downloading maps. I wanted to do a long time before, but finally ...

        - so please, try it and help me to catch all bugs or improve things that are not quite intuitive.

        - look on icon design. It's no my own, cause I'm not graphically talented. I someone want to create graphics for Locus, or if you know any place with nice icons, it will be very welcome :)

      168
      Cartridge experience / GC252QC - Celtic adventure
      « on: October 26, 2010, 13:27:13 »
      application version: 0.4.5
      playable: YES
      problems: no

      http://http://coord.info/GC252QC

      169
      Cartridge experience / GC2576D - Zatraceny mudla!
      « on: October 26, 2010, 13:22:51 »
      application version: 0.4.5
      playable: YES
      problems: no

      http://http://coord.info/GC2576D

      170
      News & Hints / [FAQ]
      « on: October 25, 2010, 23:02:34 »
      • QUESTION - how to download cartridges?
        • Android web browser (and extensions like Dolphin Browser, ...) have bug when downloading GWC files (as well as other file types, for example locations on geocaching.com). So for correct work, you have to download GWC files thanks to your desktop computer. Use firefox, opera, internet explorer, just whatever but DO NOT USE PHONE BROWSER, PLEASE!
        • Thanks to fuhur testing - Opera Mobile browser allow direct download of cartridges in field!

      • QUESTION - how to upload completed savegame GWS files?
        • there are NO savegame files GWS as on other platforms. This feature is not currently implemented. Instead, WhereYouGo, as well as OpenWIG, use inner OWS format which cannot unlock game on Wherigo pages!!!
        • so, to complete cartridge, you have to use UNLOCK KEY. If this is not implemented in cartridge, ask creator, to do this!

      171
      Released / [APP] - version 0.3.1
      « on: October 25, 2010, 06:40:58 »
      - fixed problems with downloading map on some areas

      172
      Cartridge experience / GC2382T - Stinadla se bouri
      « on: October 11, 2010, 12:43:11 »
      application version: 0.4.8
      playable: YES
      problems: little
       - missing map of smallest house, fortunately it's well known traditional cache

      http://http://coord.info/GC2382T

      173
      For creating Offline maps on PC is absolute perfect application Mobile Atlas Creator (Mobac). I’ll not describe here how to work with this software, but I’ll tell what to do, to create maps for Locus, which is not in Mobac output list. This manual now contain two methods. One is for creating TARED map files, almost same as Locus create during own map creating process. This is supported since version 0.2.0. Second is what Locus fully support since version 0.6.10. This is SQLiteDB map type. I currently not tested which is faster, it's just on you which choose. SQLiteDB is easier to create. Also SQLiteDB can have unlimited size (TARed maps are suggested not to be bigger then 1GB), but require more time to initialize!

      So, let's create it ...
      I suggest to run Mobac with custom "run.bat" file, containg:
          java -jar Mobile_Atlas_Creator.jar -Xmx 1024M
       this allow mobac to use enough memory to download really big maps <!-- s;) --> ;) <!-- s;) -->

      First step, in Settings -> Map size -> Maximum size – choose biggest value. (screenshot 1)

      SQLiteDB Maps - needed version: 0.6.10 and higher
      • Important is output format. Set it to BigPlanet/RMaps SQLite.
      • Choose area and start creating (screenshot 2).
      • After map creating, only thing to do is copy created file (rename as you want) into Locus/maps on SD card, and that's all <!-- s;) --> ;) <!-- s;) -->

      WARNING: Due to limitation of Android platform, create maps smaller then 2GB (more here)!!!


      TARED Maps - needed version: 0.2.0 and higher
      • Important is output format. Set it to TrekBuddy tared atlas.
      • Choose area and start creating (screenshot 2).
      • After map creating, only thing to do is copy all tar map files, into one directory, so in my example, I created directory Europe OSM, and into this (as on screenshot 3), I copied all tar files created by Atlas Mobile Creator.
      • Whole directory copy into /sdcard/Locus/maps and start application (you have to wait for a a while (up to few minutes with 1GB file) to initialize all map files). Enjoy
      Warning: highly suggest not to download files bigger then 1GB (may cause Out of memory errors on Android machines with lower Java application memory) !!!

      174
      Information / [MANUAL] - converting OZFX maps to Locus
      « on: October 04, 2010, 12:08:21 »
      INFO: this tool is almost 2 years old and need few improvements. If you want to help, want to use OZFX or other raster maps and know Java at least a little, look here!

      needed version - 0.3.0 and higher

      1. suggest you have two files, *.ozfx3 (map file) or *.ozfx2 (older map file format) and *.map (map definition map file). Both place into same directory.
      For this example, I'll use imaginary files world.ozfx3, world.map!

      2. download attached ozfx to locus.zip file. Extract all. First step is to convert map file into basic image. So, run from command line
      Code: [Select]
      ozf2img -iworld.map- path to file can also point on directory (for batch convert)
      - 'iworld.map' is not a mistake, so take care '-i' and 'map' on end
      - this should create file world.png (with almost same size as world.ozfx3)

      3. run imageCutter.bat. It's java program that I wrote "long" time ago. Need some improvements also, but this is not a priority now.
      - click on Select and choose png file
      - in Output directory select place, where to create new map
      - in Tile size choose ideal size values. These values are generated from png image by dividing '2'. Ideal values are around 250 x 250. Bigger then 1000 aren't suggested (possibility to out of memory error on Android).
      - check Compress tiles into TAR (this will compress all data into one TAR file
      - check Attach Projection file and select world.map file. This will pack this required configuration file into TAR file also.

      then click OK and just wait for your map

      created map upload to /sdcard/Locus/maps into your android phone.

      [attachment=1:1vntv3gf]imageCutter.PNG[/attachment:1vntv3gf]

      175
      Testing / [APP] - version 0.3.0 RC1
      « on: October 04, 2010, 11:25:30 »
      version for testing before release on Android Market

      [attachment=0:lkzq65mw]0.3.0 RC1.apk[/attachment:lkzq65mw]

      EDIT: topic closed, application in version 0.3.0 is on market now

      Pages: 1 ... 10 11 [12]