PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Java Error Message
Java Error Message
Started by Abdul Mojeb Hadji Atief, Jun., 21 2016 8:33 AM - 2 replies
Posted on June, 21 2016 - 8:33 AM
hi WM experts,

I've created a global procedure in my WM project and I pasted this lines of code in java

import java.util.ArrayList;
import org.osmdroid.DefaultResourceProxyImpl;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.ItemizedIconOverlay;
import org.osmdroid.views.overlay.OverlayItem;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.text.InputType;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.Toast;

public class Map extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

MapView mapView = new MapView(this, 256);
mapView.setClickable(true);
mapView.setBuiltInZoomControls(true);
mapView.setMultiTouchControls(true);
setContentView(mapView);
mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
mapView.getController().setZoom(14);
mapView.setUseDataConnection(false);

Drawable markerDrawable;
markerDrawable = getResources().getDrawable(R.drawable.marker);

GeoPoint center = new GeoPoint(14.487868, 121.043747);
ArrayList<OverlayItem> list = new ArrayList<OverlayItem>();
OverlayItem item = new OverlayItem("Here", "What ever", center);
item.setMarker(markerDrawable);
list.add(item);

DefaultResourceProxyImpl resProxy = new DefaultResourceProxyImpl(getApplicationContext());
ItemizedIconOverlay<OverlayItem> overyLay = new ItemizedIconOverlay<OverlayItem>(list,
new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
return true;
}
public boolean onItemLongPress(final int index, final OverlayItem item) {
return true;
}
}, resProxy);

mapView.getOverlays().add(overyLay);
mapView.getController().setCenter(center);
}
}


every time I run the program for testing, I've got this error message

Error Code : 1185
The call to native code is not available.

Can anyone tell what's that error message mean?

Thanks in advance.

mojeb
Posted on June, 21 2016 - 1:25 PM
Hi

you are in test mode...

Test mode is a SIMULATION of the android system, but does NOT include a
JAVA engine (there is no java complation before the simulation starts)...

therefore, anything in java can be test only after compiling, on a real
android hardware

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on June, 21 2016 - 4:15 PM
Hi

All these commands this function exist in the native language, use the help.windev.com site and type in the search field GPS, map and on my website that link has several examples with ready codes:

http://www.wxinformatica.com.br/p/indice.html


It has a ready example in the tool using GPS in search of examples type GPS and vera how simple their use. From what I read in your Java code you want the following features:

MyPosition is geoPosition
MyPosition..Latitude = Latitude
MyPosition..Longitude = Longitude

ok = MapDisplayPosition(ControleMapa, MyPosition)

http://forum.pcsoft.fr/fr-FR/pcsoft.us.windevmobile/739-gps-detect-position-detectar-posicao/read.awp
http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/1266-gps-controlando-zoom/read.awp
http://forum.pcsoft.fr/fr-FR/pcsoft.us.windevmobile/621-gps-ponto-central/read.awp

:thank you:

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/