Select to view content in your preferred language

Offline Map show nothing

722
1
11-14-2022 08:20 AM
bryan_hugo
New Contributor

code:

String path="/storage/emulated/0/Android/data/003_Topographic.TPK";
Log.i("bryan_test",path);
File file=new File(path);
if(!file.exists()){
Log.i("bryan_test","file does not exist");
return;
}
ArcGISTiledLayer layer=new ArcGISTiledLayer(file.getPath());
ArcGISMap map= new ArcGISMap(new Basemap(layer));
mapView.setMap(map);



Log:
2022-11-15 00:17:31.634 14426-14426/? I/e.myapplicatio: Late-enabling -Xcheck:jni
2022-11-15 00:17:31.668 14426-14426/? E/libc: Access denied finding property "persist.device_config.runtime_native.use_app_image_startup_cache"
2022-11-15 00:17:31.668 14426-14426/? E/e.myapplicatio: LoadAppImageStartupCache enabled : 1
2022-11-15 00:17:31.668 14426-14426/? E/e.myapplicatio: Unknown bits set in runtime_flags: 0x8000
2022-11-15 00:17:31.669 14426-14426/? I/e.myapplicatio: Reinit property: dalvik.vm.checkjni= false
2022-11-15 00:17:31.669 14426-14426/? I/e.myapplicatio: ReInitProperties: persist.vm.debug.dumpapi= false
2022-11-15 00:17:31.662 14426-14426/? W/e.myapplicatio: type=1400 audit(0.0:40258): avc: denied { read } for pid=14426 name="u:object_r:device_config_runtime_native_prop:s0" dev="tmpfs" ino=17467 scontext=u:r:untrusted_app:s0:c82,c258,c512,c768 tcontext=u:object_r:device_config_runtime_native_prop:s0 tclass=file permissive=0
2022-11-15 00:17:31.699 14426-14426/? D/ActivityThread: Attach thread to application
2022-11-15 00:17:31.733 14426-14449/com.example.myapplication I/ActivityThread: Init compatible state: true
2022-11-15 00:17:31.738 14426-14449/com.example.myapplication D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
2022-11-15 00:17:31.738 14426-14449/com.example.myapplication I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
2022-11-15 00:17:31.741 14426-14449/com.example.myapplication D/BehaviorCollectManager: hook process for AI virus second
2022-11-15 00:17:31.743 14426-14449/com.example.myapplication I/BehaviorCollectManager: bindAnalyzerService: huawei.android.security.IAppBehaviorDataAnalyzer$Stub$Proxy@93c9358 pid:14426
2022-11-15 00:17:31.828 14426-14426/com.example.myapplication D/ApplicationLoaders: createClassLoader zip: /data/app/com.example.myapplication-CWcmT41cR9l8JEUb-yoA5Q==/base.apk librarySearchPath: /data/app/com.example.myapplication-CWcmT41cR9l8JEUb-yoA5Q==/lib/arm64:/data/app/com.example.myapplication-CWcmT41cR9l8JEUb-yoA5Q==/base.apk!/lib/arm64-v8a libraryPermittedPath: /data/user/0/com.example.myapplication parent: java.lang.BootClassLoader@6de31f targetSdkVersion: 31 isBundled: false classLoaderName: null sharedLibraries: null
2022-11-15 00:17:32.484 14426-14449/com.example.myapplication I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.myapplication#10594#256
2022-11-15 00:17:32.484 14426-14449/com.example.myapplication I/HwApiCacheMangerEx: need clear apicache,because volumes changed,oldCnt=0 newCnt=1
2022-11-15 00:17:32.486 14426-14449/com.example.myapplication I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.myapplication#10594#0
2022-11-15 00:17:32.486 14426-14449/com.example.myapplication I/HwApiCacheMangerEx: need clear apicache,because volumes changed,oldCnt=1 newCnt=1
2022-11-15 00:17:32.496 14426-14449/com.example.myapplication I/HwPartIawareFactory: add android.common.HwPartIawareFactoryImpl to memory.
2022-11-15 00:17:32.496 14426-14449/com.example.myapplication I/AwareBitmapCacher: init processName:com.example.myapplication pid=14426 uid=10594
2022-11-15 00:17:32.579 14426-14426/com.example.myapplication I/HwTypeface: updateFont: scale=0.95
2022-11-15 00:17:32.580 14426-14426/com.example.myapplication D/SystemFonts: areFontsVariable: script=Hans
2022-11-15 00:17:32.581 14426-14426/com.example.myapplication I/ActivityThread: finishPreloaded preloadStatus 0
2022-11-15 00:17:32.630 14426-14426/com.example.myapplication D/OpenGLRenderer: disableOutlineDraw is true
2022-11-15 00:17:32.640 14426-14550/com.example.myapplication I/OpenGLRenderer: RenderThread: progress name = [com.example.myapplication], viewCornerType = 0
2022-11-15 00:17:32.645 14426-14552/com.example.myapplication I/iGraphics: [0020080c] pn: com.example.myapplication, p: 14426
2022-11-15 00:17:32.645 14426-14552/com.example.myapplication I/iGraphics: [0030080c] no spt app: com.example.myapplication
2022-11-15 00:17:32.834 14426-14426/com.example.myapplication V/ActivityThread: callActivityOnCreate
2022-11-15 00:17:32.912 14426-14426/com.example.myapplication I/DecorView[]: pkgName:com.example.myapplication old windowMode:0 new windoMode:1, isFixedSize:false
2022-11-15 00:17:32.957 14426-14426/com.example.myapplication I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config
2022-11-15 00:17:32.957 14426-14426/com.example.myapplication I/OverScrollerOptimization: get the overscroller config
2022-11-15 00:17:33.037 14426-14426/com.example.myapplication W/e.myapplicatio: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2022-11-15 00:17:33.040 14426-14426/com.example.myapplication W/e.myapplicatio: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2022-11-15 00:17:33.226 14426-14426/com.example.myapplication I/bryan_test: /storage/emulated/0/Android/data/003_Topographic.TPK
2022-11-15 00:17:34.042 14426-14426/com.example.myapplication W/e.myapplicatio: Verification of void com.esri.arcgisruntime.internal.util.j$a.<clinit>() took 630.870ms
2022-11-15 00:17:34.180 14426-14426/com.example.myapplication D/ActivityThread: add activity client record, r= ActivityRecord{90e5701 token=android.os.BinderProxy@d04f517 {com.example.myapplication/com.example.myapplication.MainActivity}} token= android.os.BinderProxy@d04f517
2022-11-15 00:17:34.206 14426-14426/com.example.myapplication I/HwPartMagicWindowFactory: add android.common.HwPartMagicWindowFactoryImpl to memory.
2022-11-15 00:17:34.229 14426-14426/com.example.myapplication D/MouseWheelSynthesizer: mMoveStepInDp: 64, mMoveStepInPixel: 192, mUpTimeDelayed: 100
2022-11-15 00:17:34.231 14426-14426/com.example.myapplication D/ViewRootImpl: ViewRootImpl mIsInProductivePCDisplay: false
2022-11-15 00:17:34.233 14426-14426/com.example.myapplication I/HwPartPowerOfficeFactory: add HwPartPowerOfficeFactoryImpl to memory.
2022-11-15 00:17:34.250 14426-14426/com.example.myapplication D/InputEventReceiver: dispatchInputInterval 1000000
2022-11-15 00:17:34.288 14426-14616/com.example.myapplication I/HiTouch_HiTouchSensor: HiTouch restricted: Keyguard locked restricted.
2022-11-15 00:17:34.288 14426-14616/com.example.myapplication D/HiTouch_PressGestureDetector: onAttached, package=com.example.myapplication, windowType=1, mIsHiTouchRestricted=true
2022-11-15 00:17:34.306 14426-14550/com.example.myapplication D/OpenGLRenderer: disableOutlineDraw is true
2022-11-15 00:17:34.871 14426-14473/com.example.myapplication D/ZrHung.AppEyeUiProbe: not watching, wait.

mainfest:

 

build.gradle:

 

plugins {
id 'com.android.application'
}

android {
compileSdk 31

defaultConfig {
applicationId "com.example.myapplication"
minSdk 23
targetSdk 31
versionCode 1
versionName "1.0"

multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
debug{
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

sourceSets{
main{
jniLibs.srcDirs=['lib']
}

}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation files('libs/arcgis-android-100.15.0.aar')
// implementation 'com.esri.arcgisruntime:arcgis-android:100.15.0'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'org.apache.httpcomponents.core5:httpcore5:5.0.4'
implementation 'org.apache.httpcomponents.core5:httpcore5-h2:5.0.4'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.conscrypt:conscrypt-openjdk-uber:2.2.1'
implementation 'net.spy:spymemcached:2.12.3'
implementation 'org.ehcache.modules:ehcache-api:3.4.0'
}
Tags (1)
0 Kudos
1 Reply
RamaChintapalli
Esri Contributor

Hi,
To use local tilecache (.tpk) , you need to use the other constructor that takes in a TileCache which you construct using file path. Also
you can check the loadstatus and loaderror on the TiledLayer whenever it fails that will provide more information on whats going wrong.

Thanks
Rama

0 Kudos