Log of #mupdf at irc.freenode.net.

 <<<Back 1 day (to 2019/01/10)20190111 
Caula Hello there10:44.14 
  I came here two days ago asking some questions, I have now come back with some new question (and thanks for helping me)10:44.50 
  I'm now using Android Studio instead of Visual Studio, I'm following the Android SDK tutorial for builind mupdf on the android sdk10:45.22 
  I'm stuck at the point of adding the mupdf-lib in my project, when I do it and change the gradle files as the tutorial says, I get:10:46.12 
  "Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :mupdf-lib."10:46.26 
  "Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :mupdf-lib."10:46.45 
  And like 3 others similar, can I ask some help? :)10:47.03 
ator Caula: sure. I just spent yesterday refamiliarizing myself with the android stuff.10:58.45 
  let me see if I can replicate your problems10:59.04 
  Caula: this page https://mupdf.com/docs/android-sdk.html is the one you're referring to, I hope10:59.41 
Caula_ (got disconnected again)11:00.48 
  anyway, this is what I do:11:01.25 
  I create a new project, with empy activity11:01.36 
  I add what the tutorial says11:01.50 
  I copy the two provided functions to my mainactivity11:02.05 
  then I have to import some libraries (I'm not even sure they're called libraries in Java) (Intent, Uri, File)11:02.43 
Caula (this irc hates me ahah)11:03.29 
ator Caula: have you tried using an IRC bouncer?11:03.46 
Caula well that's a new thing I have to google :)11:04.57 
  I connected using auth, if I disconnect again I'll take a look at that, thanks :)11:05.16 
  so I do those steps, and the app builds fine, of course doesn't show anything since I'm not calling startMuPDFActivityWithExampleFile()11:06.06 
  1) if I try to launch startMuPDFActivityWithExampleFile() the app crashes11:06.24 
  2) when I add mupdf-lib and the lines in point 4 I can't build11:06.43 
  because of the errors I pasted before11:06.50 
  @ator sorry, I just read the log, yes that's the page I'm using11:13.37 
ator Caula: okay, I've gone through the steps to build a new project using the library (but not yet invoking the activity)11:13.40 
  one step I found missing in the docs11:13.46 
  you need to add in the Project/build.gradle file in the allprojects { repositories { ... maven { url 'http://maven.ghostscript.com' } } }11:14.25 
  here's what I did step by step:11:14.46 
  1) create a new Android Studio project with an empty activity11:14.57 
  2) copy the 'lib' directory from a checkout of mupdf-android-mini (or -viewer, shouldn't matter which one)11:15.17 
  3) that's "cp -r ~/src/mupdf-android-mini/lib ~/AndroidStudioProjects/MyNewApp/mupdf-lib"11:15.52 
  4) edit ~/AndroidStudioProjects/MyNewApp/settings.gradle to add a line "include :mupdf-lib"11:16.16 
  5) edit ~/AndroidStudioProjects/MyNewApp/build.gradle to add a line "maven { url 'http://maven.ghostscript.com/' } to the allprojects.repositories section11:16.51 
  6) edit ~/AndroidStudioProjects/MyNewApp/app/build.gradle to add "implementation project(':mupdf-lib')" to the dependencies section11:17.28 
Caula isn't step 5 (the one you said missing) the second line of point 2 in the tutorial?11:20.04 
ator Caula: oh, yes. sorry.11:21.01 
  so it is.11:21.05 
Caula testing right now11:21.34 
  ok, you might have noticed that aside this, in the example function there's a missing semicolon11:28.36 
  I am not getting the errors from before now11:30.14 
  but import com.artifex.mupdf.viewer.DocumentActivity; can't be found11:30.20 
ator yes, there's a semicolon missing11:30.23 
  did you copy the mupdf-mini or mupdf-viewer library?11:30.40 
Caula mini11:30.44 
ator try import com.artifex.mupdf.mini.DocumentActivity instead then11:31.04 
Caula ahhh11:33.31 
  now it compiled11:33.33 
  I still can't open the pdf for permissions, but I think I can handle it right now11:33.52 
ator you'll probably get a 'permission denied' error11:33.57 
Caula thank you very much anyway!11:33.58 
  yep ahah11:34.04 
ator but that's something you'll need to tweak in your app to grant the correct app permissions11:34.12 
Caula yes11:34.19 
ator you can poke around in the mupdf-mini/app/*/LibraryActivity.java to see how to do that11:34.38 
  if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED)11:34.56 
  ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST);11:34.56 
Caula sorry I don't understand where I'm supposed to find this mupdf-mini/app/*/LibraryActivity.jav11:38.29 
ator in the git repository where you copied the 'lib' directory from11:39.42 
Caula ah found it11:40.05 
  ok thanks11:40.09 
ator that's the 'file picker' activity that the mupdf-mini app shows when you just open it11:40.26 
Caula but this part is not included in my app11:41.06 
  what's the best way to include this permissions in my project?11:41.33 
ator add those lines (and the needed imports and constants) in your main activity in the onCreate function11:48.06 
Caula ah perfect11:48.35 
  everything is working now, even though the first time after asking permission it didn't work11:54.54 
  right now I'm looking at my pdf11:55.00 
  now I'll start making a new layer in order to draw on the pdf :)11:55.28 
  thank you so much @ator11:55.44 
ator Caula: I guess because the permission thing is forked off in the background, and your app proceeds to try to load the document before it has been granted12:09.07 
enan Hello, guys13:46.17 
  I want to know the keyboard shortcut for viewing page number in mupdf-gl13:46.37 
ator enan: just type '55g' to go to page 5513:46.52 
enan But what do I do if I want to know the current page number13:47.12 
  The page I'm currently in?13:47.23 
ator look in the title bar13:47.51 
enan I'm using i3wm without title bar13:48.12 
  Shouldn't there be a keyboard shortcut?13:48.21 
  like mupdf-x11's `P`13:48.29 
ator is there no short cut to display the title bar in i3wm? there usually is one for WMs which hide the title bars by default, like evilwm.13:48.59 
enan i3 doesn't have that13:49.37 
ator enan: it would probably be easy enough to add a line showing the current page in the 'i' info box13:49.41 
enan exactly13:49.58 
  But current version doesn't have current page number in `i`13:50.48 
ator enan: http://git.ghostscript.com/?p=user/tor/mupdf.git;a=commitdiff;h=df3c3ed106d59269213e71d83056f3dd1ff6e49c13:52.22 
enan @ator, thanks13:53.01 
 Forward 1 day (to 2019/01/12)>>> 
ghostscript.com #ghostscript