Http://bbs.lbsyun.baidu.com/forum.php?mod=viewthread&tid=81792&page=1&extra= #pid142038
I have said in the Baidu Forum, I will not copy over ...
Look at others said, the configuration is different. In as configure those so to be configured like the NDK = =
http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/
Above is the NDK configuration
If you can't turn the wall, look at my turn = =
At the end, I upload my code = = for everyone to learn
Fragment class
package org.moziqi.generic.company.fragment;import android.os.bundle;import com.baidu.mapapi.map.supportmapfragment;public class explorefragment extends Supportmapfragment { private static final string arg_section_ title = "Section_title"; /** * Returns the fragment */ public static created by the title parameter Supportmapfragment newinstance (string title, com.baidu.mapapi.map.baidumapoptions Baidumapoptions) { SupportMapFragment Supportmapfragment = newinstance (baidumapoptions); Bundle args = new bundle (); args.putstring ( Arg_section_title, title); supportmaPfragment.setarguments (args); return supportmapfragment; }}
Key code for//mainacitivity
==================================================================fragments = new arraylist< Fragment> (); Mapstatus ms = new mapstatus.builder (). Overlook ( -20). Zoom (). build (); Baidumapoptions bo = new baidumapoptions (). Mapstatus (ms) .compassenabled (False). ZoomControlsEnabled ( FALSE); Fragments.add (explorefragment.newinstance ("Discovery", bo)); ============================================= =========================string[] itemtitle = getresources (). Getstringarray (R.array.item_title) ; fragmentmanager fragmentmanager = Getsupportfragmentmanager (); fragmenttransaction ft = fragmentmanager.begintransaction (); currentfragment = fragmentmanager.findfragmEntbytag (title); for (int i = 0; i < itemtitle.length; i++) { if (Itemtitle[i].equals (title)) { if (currentfragment == null) { Currentfragment = fragments.get (i); ft.add (r.id.container, currentfragment, title); } if ( Lastfragment != null) { ft.hide (lastfragment); } if (currentfragment.isdetached ()) { ft.attach (currentFragment); } ft.show (currentFragment); lastfragment = currentFragment; ft.commit (); onsectionattached (title); } }
package org.moziqi.generic.common.constant;import android.app.application;import android.content.context;import android.content.sharedpreferences;import android.content.res.configuration;import android.preference.preferencemanager;import Android.support.v4.content.localbroadcastmanager;import android.util.log;import android.widget.toast ; import com.baidu.mapapi.sdkinitializer;/** * created by moziqi on 2015/1/ 29 0029. */public class genericapplication extends application { private final static String TAG = "Genericapplication"; private static genericapplication instance; public static genericapplication getinstance () { return instance; } @OverridE public void oncreate () { super.oncreate (); sdkinitializer.initialize (this); instance = this; } @Override public void onlowmemory () { super.onlowmemory (); showlog (" System is in a state of scarcity "); } @Override public void ontrimmemory (int level) { super.ontrimmemory ( Level); } @Override public void onconfigurationchanged (Configuration newconfig) { super.onconfigurationchanged (NEWCOnfig); } /** * Print toast * * @param msg */ public static void showtoast (string msg) { toast.maketext (Instance, msg, toast.length_long). Show (); } /** * Print Logs * * @param msg */ public static void showlog (string msg) { showlog (tag, msg); } public static Void showlog (string tag, string msg) { &NBSP;LOG.E (tag, msg); } /** * getting a local broadcaster * * @return */ public static localbroadcastmanager getlocalbroadcastmanager () { LocalBroadcastManager instance1 = Localbroadcastmanager.getinstance (instance); return Instance1; } public sharedpreferences sharepreference ( String name, int mode) { sharedpreferences sharedpreferences = getsharedpreferences (Name, mode); return sharedPreferences; } private Sharedpreferences.editor usereditor () { &Nbsp; sharedpreferences user = sharepreference ("User", Context.mode_private); sharedpreferences.editor edit = user.edit (); return edit; } public void savenewuserinfo (String username, string password) { SharedPreferences.Editor edit = Usereditor (); edit.putstring ("username", username); edit.putstring ("password", password); edit.commit (); } public void Deletecurrentuserinfo () { SharedPreferences.Editor Edit = usereditor ();Nbsp; edit.remove ("username"); edit.remove ("password"); edit.commit (); }}
Android Studio use Baidu lbs has Jnicommonmemcache