[Android] Emulator freezes constantly

I solved that full-wiping emulator’s dalvik cache. In AVD Manager, click on the desired AVD, then on the right options, select “Wipe data”

Advertisements

[iOS SDK] Creating my own offline map with Mapbox (.mbtiles format)

In order to create a new .mbtiles map for Mapbox’s iOS SDK, we need to use Mobile Atlas Creator (MOBAC).

1.- Open the MOBAC tool, Select Atlas > New Atlas.

2.- In the Map Source menu, select “OpenStreetMap MapQuest”

3.- Find the place (in our case, the Royal Alcazar of Seville). Draw a Square that covers the whole zone of interest.

alcazar1.PNG

4.- Mark the “Recreate/adjust map tiles (CPU intensive)” checkbox. Select desired zoom levels (in our case, 15,16,17 and 18 will be enough).

5.- On the Atlas Content menu, select “Add Selection”. Name it whatever you want, in my case it will be “Alcazar1”.

alcazar2.PNG

6.- In MOBAC tool, select Atlas > Create Atlas. It will take a few seconds/minutes, and click “Open atlas folder” when done.

alcazar3.PNG

7.- There you have your .mbtiles map. Now that it is created, you can proceed to this Mapbox Integration tutorial to configure Mapbox in your iOS App.

Let me know if it helps!

[Android] Configuring a quick test environment

In order to start writing tests for our app, one quick solution could be this one:

1.- Adding junit to our build.gradle file

dependencies{
...
testCompile 'junit:junit:4.12'
}

2.- Creating the test folder structure
This can be done with Android Studio, or directly in your file explorer (finder, nautilus, etc). Create the folder

your_app_folder/app/src/test/java/com/companyname/appname/

where the app’s package name would be com.companyname.appname (substitute by yours).

3.- Creating a sample test
Inside the recently created folder, create a file named ProjectTest.java and copy this content:

public class ProjectTest {
@Test
public void shouldCompare1To1() throws Exception {
assertEquals(1, 1);
}
}

4.- Running the tests in console
Go to terminal, move to your app’s folder and do

./gradlew test

If everything went fine, you should have a single test passing