Well now for the solution.
I created a seperate projects. I called it MapInvoke, set it up as a Library, and it has one single class, which extends (believe it or not) the Vector class. The reason for extending is so that we can easily use the Base class in another project and call the overridden base methods, without declaring the class in the other project. And here is the code:
public class MapInvoke extends java.util.Vector
public void setElementAt(Object contact, int addressIndex)
MapsArguments args = new MapsArguments((Contact)contact ,0);
Invoke.invokeApplication( Invoke.APP_TYPE_MAPS, args);
Now in my Main project when I have to call this Class, I use this code:
java.util.Vector mapInvoke = (java.util.Vector)cmi.newInstance();
mapInvoke.setElementAt(contact, 0); // This invokes it
catch (Exception e) // usually old model that does not have Maps
Since the new Class is not included in your Main Project (and you cannot include it), you have to use UpdateJad.exe to add the COD file to your project, and you will have to add it manually to your alx file.
I tested this method, and it works.