Talk to Core/Photon over Wifi, but no local network available?

As for the source code for the phone apps I’d take a look at either the

As for your second question: if you are using the cloud you do need an internet connection to run functions like variable(), publish(), subscribe(), etc. If you want something that talks directly to your phone app I would look into the VoodooSpark firmware (https://github.com/voodootikigod/voodoospark)