Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML and Android how to get internalDataPath?  (Read 1503 times)

0 Members and 1 Guest are viewing this topic.

madcat

  • Newbie
  • *
  • Posts: 21
  • Creator of TacWars
    • View Profile
    • TacWars
SFML and Android how to get internalDataPath?
« on: September 09, 2017, 05:25:15 pm »
Hi everyone,

Using the NDK,
I'm trying to get the Activity's internal Data Path from main(arg, argv)

 

int man(int arg, char **argv)
{
  // here I want activity->internalDataPath
  string path( /* ??? */ );
  ...  
}
 
in main(argc, argv)

I've changed MainAndroid to send it as an argument to a mainAndroid(const char* s)
but it's sort of nasty...
is there any clean way?

I've seen this post as well https://en.sfml-dev.org/forums/index.php?topic=13716.240 but it's also a bit violent.

Anybody knows a way that doesn't require modifying the SFML source code?

 :o(power2)



madcat

  • Newbie
  • *
  • Posts: 21
  • Creator of TacWars
    • View Profile
    • TacWars
Re: SFML and Android how to get internalDataPath?
« Reply #1 on: September 09, 2017, 10:31:29 pm »
well... I missed it  ;D
it was right there in front of me in SFML/System/NativeActivity.hpp

  ANativeActivity* na = sf::getNativeActivity();
  LOGI("[PATH]=[%s]", na->internalDataPath);