1st version that works
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
public class AudioEvent extends EventObject {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] data;
|
||||
private int len;
|
||||
public AudioEvent(Object source, byte[] _data, int _len) {
|
||||
super(source);
|
||||
data =_data;
|
||||
len = _len;
|
||||
}
|
||||
public byte[] data() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public int len()
|
||||
{
|
||||
return len;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
public interface IAudioListener {
|
||||
public void soundReceived( AudioEvent event );
|
||||
public void soundSent( AudioEvent event );
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
import com.safemobile.lib.radio.IncCall;
|
||||
|
||||
public interface ICallStatusListener {
|
||||
|
||||
public void decoded ( IncCall call );
|
||||
public void initiated ( IncCall call );
|
||||
public void inProgress ( IncCall call );
|
||||
public void hangtime ( IncCall call );
|
||||
public void ended ( IncCall call );
|
||||
|
||||
/** Event used when any incoming Call message is received */
|
||||
public void incoming (IncCall call );
|
||||
}
|
210
libSafeMobile/src/main/java/com/safemobile/interfaces/IMap.java
Normal file
210
libSafeMobile/src/main/java/com/safemobile/interfaces/IMap.java
Normal file
@ -0,0 +1,210 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.safemobile.enums.MapType;
|
||||
import com.safemobile.lib.Position;
|
||||
import com.safenet.lib.Geofence;
|
||||
import com.safenet.lib.Landmark;
|
||||
import com.safenet.lib.Unit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by Adi on 3/25/2016.
|
||||
*/
|
||||
public interface IMap {
|
||||
|
||||
interface MapInteraction
|
||||
{
|
||||
void onMapLocationChanged(double latitude, double longitude, float zoomLevel);
|
||||
void onInfoBubbleClosed(long assetId, LatLng position);
|
||||
void onInfoBubbleOpened(long assetId, LatLng position);
|
||||
}
|
||||
|
||||
void setMapInteractionListener(MapInteraction delegate);
|
||||
|
||||
long MYSELF = 0l;
|
||||
long LABEL_START = 16777215;
|
||||
|
||||
|
||||
int MAPBOX = 1;
|
||||
int GOOGLE = 2;
|
||||
int OSM = 3;
|
||||
|
||||
|
||||
/** INTENTS **/
|
||||
String MAP_TERRAIN_REQ = "MAP_TERRAIN_REQ";
|
||||
String MAP_SATELLITE_REQ = "MAP_SATELLITE_REQ";
|
||||
String MAP_NORMAL_REQ = "MAP_NORMAL_REQ";
|
||||
String MAP_HYBRID_REQ = "MAP_HYBRID_REQ";
|
||||
String MAP_SHOW_ME = "MAP_SHOW_ME";
|
||||
String MAP_LOCATION_REQUEST = "MAP_LOCATION_REQUEST";
|
||||
|
||||
/** GOOGLE MAP TYPE **/
|
||||
int MAP_TYPE_NONE = 0;
|
||||
int MAP_TYPE_NORMAL = 1;
|
||||
int MAP_TYPE_SATELLITE = 2;
|
||||
int MAP_TYPE_TERRAIN = 3;
|
||||
int MAP_TYPE_HYBRID = 4;
|
||||
|
||||
/**
|
||||
* Display the contacts that are flaged as onMap to be drawn on the
|
||||
* Google map. The list is available on the AppParams .
|
||||
* The same function will remove previous contacts that were on the map
|
||||
* @param units The list of assets that needs to be displayed
|
||||
*/
|
||||
void showContactsOnMap(ArrayList<Unit> units);
|
||||
|
||||
|
||||
/**
|
||||
* Update the marker icon/location if displayed else do nothing. This method is called
|
||||
* whenever the asset position is changed, or when the asset goes offline/online or in emergency
|
||||
* @param unit The asset that changed the state or position
|
||||
*/
|
||||
void updateMarkerPosition(Unit unit);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Change the map type to one of the following options
|
||||
* GoogleMap.MAP_TYPE_HYBRID
|
||||
* GoogleMap.MAP_TYPE_NORMAL
|
||||
* GoogleMap.MAP_TYPE_SATELLITE
|
||||
* GoogleMap.MAP_TYPE_TERRAIN
|
||||
* @param mapType The mapType value of the map
|
||||
*/
|
||||
void setMapType(MapType mapType);
|
||||
|
||||
|
||||
/**
|
||||
* Change the map type to one of the following options
|
||||
* Style.MAPBOX_STREETS
|
||||
* Style.EMERALD
|
||||
* Style.LIGHT
|
||||
* Style.DARK
|
||||
* Style.SATELLITE
|
||||
* Style.SATELLITE_STREETS
|
||||
* @param mapType The int value of the map
|
||||
*/
|
||||
void setMapType(String mapType);
|
||||
|
||||
|
||||
/**
|
||||
* Center map and then zoom to the location of a specific contact
|
||||
* @param unit The contact which needs to be focused. It contains the
|
||||
* gps location
|
||||
*/
|
||||
void centerZoomContact(Unit unit);
|
||||
|
||||
/**
|
||||
* Center the map on a particular position represented by a LatLng point
|
||||
* @param mapLocation Location to which the map needs to center
|
||||
*/
|
||||
void centerZoomMapOnLocation(LatLng mapLocation);
|
||||
|
||||
|
||||
/**
|
||||
* Center the map on a particular position represented by a LatLng point
|
||||
* @param mapLocation Location to which the map needs to center
|
||||
* @param zoomLevel The zoom at which the map needs to be set
|
||||
*
|
||||
*/
|
||||
void centerZoomMapOnLocation(LatLng mapLocation, float zoomLevel);
|
||||
|
||||
|
||||
/**
|
||||
* Show a custom marker on the map representing the current user
|
||||
* @param position The location at which the user is
|
||||
* @param shouldOpenInfoBubble Specify if the info bubble for the myself location should be opened
|
||||
* @param shouldCenterNow Specify if the map needs to be animated to that location
|
||||
*/
|
||||
void showMyselfOnMap(Position position, boolean shouldOpenInfoBubble,
|
||||
boolean shouldCenterNow);
|
||||
|
||||
|
||||
/**
|
||||
* Hide the marker for myself from the map
|
||||
*/
|
||||
void hideMyselfFromMap();
|
||||
|
||||
|
||||
/**
|
||||
* Open the info bubble for a specific marker
|
||||
* @param markerKey The marker identifier from the hashtable
|
||||
*/
|
||||
void openInfoBubbleForMarker(Long markerKey);
|
||||
|
||||
|
||||
/**
|
||||
* Open the info bubble for the last opened marker if it wasn't closed by the user explicitly
|
||||
*/
|
||||
void openInfoBubble();
|
||||
|
||||
/**
|
||||
* Show or hide the landmarks on the map
|
||||
* @param isShown Boolean that will flag if the landmarks should be
|
||||
* displayed. True is affirmative
|
||||
* @param landmarks The landmarks that needs to be shown, Empty if none
|
||||
*/
|
||||
void onShowLandmarksChangedHandler(boolean isShown, ArrayList<Landmark> landmarks);
|
||||
|
||||
|
||||
/**
|
||||
* Show or hide the geofence on the map
|
||||
* @param isShown Boolean that will flag if the geofence should be
|
||||
* displayed. True is affirmative
|
||||
* @param geofences The geofences that needs to be shown. Empty if none
|
||||
*/
|
||||
void onShowGeofencesChangedHandler(boolean isShown, ArrayList<Geofence> geofences);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show or hide the traffic on the map
|
||||
* @param isShown Boolean that will flag if the traffic should be
|
||||
* displayed. True is affirmative
|
||||
*/
|
||||
void onShowTrafficChangedHandler(boolean isShown);
|
||||
|
||||
|
||||
/**
|
||||
* Handler for when the map is ready and bound to the UI
|
||||
* @param map The received map
|
||||
* @param layoutInflater Inflater needed to inflate the InfoBubble
|
||||
*/
|
||||
void onMapReceived(Object map, LayoutInflater layoutInflater);
|
||||
|
||||
|
||||
/**
|
||||
* Handler for when the map is ready and bound to the UI
|
||||
* @param map The received map
|
||||
* @param tileServer Map tile server used for OSM or other private environments
|
||||
*/
|
||||
void onMapReceived(Object map, String tileServer);
|
||||
|
||||
/**
|
||||
* Change the map center and zoom level to allow the display of all the displayed markers
|
||||
*/
|
||||
void panZoomMap();
|
||||
|
||||
|
||||
/**
|
||||
* On activity paused
|
||||
*/
|
||||
void onPause();
|
||||
|
||||
/**
|
||||
* On activity resumed
|
||||
*/
|
||||
void onResume();
|
||||
|
||||
/**
|
||||
* Handler for when the map needs to be refreshed/invalidated
|
||||
*/
|
||||
void refresh();
|
||||
|
||||
|
||||
boolean isMapAvailable();
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
public interface IPlaybackListener {
|
||||
public void finishedPlaying();
|
||||
public void startPlaying();
|
||||
public void stopedPlaying();
|
||||
public void failedPlaying();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
public interface ITCPListener {
|
||||
public void onLoginReceived( TCPEvent event );
|
||||
public void onGPSReceived( TCPEvent event );
|
||||
public void onVehiclesReceived( TCPEvent event );
|
||||
|
||||
public void onLastSMSsReceived( TCPEvent event );
|
||||
public void onSMSReceived( TCPEvent event );
|
||||
public void onSMSAckReceived( TCPEvent event );
|
||||
public void onNewSMSReceived( TCPEvent event );
|
||||
|
||||
public void onLastPositionsReceived( TCPEvent event );
|
||||
public void onRadioMsgReceived( TCPEvent event );
|
||||
public void onHistoryPositionsReceived( TCPEvent event );
|
||||
public void onHistoryPositionsCountReceived( TCPEvent event );
|
||||
public void onAlarmsReceived( TCPEvent event );
|
||||
public void onAlarmAckReceived(TCPEvent event);
|
||||
public void alarmLiveRecv(TCPEvent event);
|
||||
|
||||
public void onRecordingPlayReceived(TCPEvent event);
|
||||
public void onPollReceived(TCPEvent event);
|
||||
public void onConnectionReplyReceived (TCPEvent event);
|
||||
|
||||
public void onContactsListReceived (TCPEvent event);
|
||||
public void onTextMessagesListReceived (TCPEvent event);
|
||||
public void onRecordingsListReceived(TCPEvent event);
|
||||
|
||||
public void onPONGReceived();
|
||||
public void onTCPConnectionDown(boolean previuosWasConnectionUp);
|
||||
public void onTCPConnectionUp(boolean previuosWasConnectionUp);
|
||||
public void onTCPConnectionStatusReceived(boolean isConnectionUp, boolean previuosWasConnectionUp);
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
public interface IUDPListener {
|
||||
public void dataRecv( UDPevent event );
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
import com.safemobile.lib.TCPmsg;
|
||||
|
||||
public class TCPEvent extends EventObject {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private TCPmsg _msg;
|
||||
|
||||
public TCPEvent(Object source, TCPmsg msg ) {
|
||||
super( source );
|
||||
_msg = msg;
|
||||
}
|
||||
public TCPmsg msg() {
|
||||
return _msg;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.safemobile.interfaces;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
public class UDPevent extends EventObject {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] data;
|
||||
private int len;
|
||||
public UDPevent(Object source, byte[] _data, int _len) {
|
||||
super(source);
|
||||
data =_data;
|
||||
len = _len;
|
||||
}
|
||||
public byte[] data() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public int len()
|
||||
{
|
||||
return len;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user