• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

vpn client

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i am trying to make a vpn client but the code does not seem to work but cant find what im doing worng if anyone knows the vpn class i would appreciate any pointers the code im running is


i have permissions in manifest

and my setting xml is
 
Marshal
Posts: 3827
537
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

john bean wrote:...  the code does not seem to work


What did you expect and what did you observe?
Any error messages or stack traces?
Anything interesting in the logs?
 
john bean
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i expected it to crash or throw exception but all that prints is


so the intent on line 12 must be null but im unsure why thnaks for reply
 
Ron McLeod
Marshal
Posts: 3827
537
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

john bean wrote:... the intent on line 12 must be null but im unsure why


The documentation for VpnService#prepare says: This method returns null if the VPN application is already prepared or if the user has previously consented to the VPN application.  Have you confirmed that a VPN Service has not already been prepared (and not revoked) - maybe a previous failed attempt?

The documentation also says: Services extending this class need to be declared with an appropriate permission and intent filter., and shows an example:Do you have this declared?
 
Ranch Hand
Posts: 118
1
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

class MyVpnService extends VpnService {


As far as I know Android services must be implemented by a public class rather than a class in package scope.
 
Get off me! Here, read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic