Page 3 of 4 FirstFirst 1234 LastLast
Results 61 to 90 of 97
  1. Collapse Details
     
    #61
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    Quote Originally Posted by Plug Drugs View Post
    Java is really old man it's like you're writing a program for Adobe flash or something
    every native android application is and always has been written in java numbnuts
    Reply With Quote
     

  2. Collapse Details
     
    #62
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Javascript is easy, a lot of people are confused between java and javascript what they think it's the same but it's not true.


    btw, maks would you mind to use node.js to solve your problem with udp?


    anyway:

    Code:
    var udp = require('udp-request')
    var socket = udp()
    
    socket.on('request', function (request, peer) {
      console.log('request:', request.toString())
      socket.response('echo: ' + request.toString(), peer)
    })
    
    socket.listen(10000, function () {
      socket.request('hello', {port: 10000, host: '127.0.0.1'}, function (err, response) {
        console.log('response', response.toString())
        socket.destroy()
      })
    })

    before to execute this, you need to do npm install, I don't know about UDP, what do you really except?


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  3. Collapse Details
     
    #63
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    the code you posted is the thing I was successfully able to do in 3 different languages.

    I want a background service that sends a broadcast *when I receive a phone call*. As far as I know I can only do that in java or xamerin.
    Reply With Quote
     

  4. Collapse Details
     
    #64
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    The same thing you wrote, in VB

    Code:
     Sub Main()
            'Console.WriteLine("Receiver")
            Do
                Dim UDPClient As UdpClient = New UdpClient()
                UDPClient.Client.SetSocketOption(SocketOptionLevel.Socket, _
                   SocketOptionName.ReuseAddress, True)
                UDPClient.Client.Bind(New IPEndPoint(IPAddress.Any, 44126))
     Try
    
                    Dim iepRemoteEndPoint As IPEndPoint = New  _
                       IPEndPoint(IPAddress.Any, 44126)
                    Dim strMessage As String = String.Empty
                    Do
                    
                        Dim bytRecieved As Byte() = _
                           UDPClient.Receive(iepRemoteEndPoint)
                        strMessage = Encoding.ASCII.GetString(bytRecieved)
    
                        Console.WriteLine("This is the message you received: " + strMessage)
                        My.Computer.Audio.Play("C:\Users\overwatch\Downloads\mario coin.wav", AudioPlayMode.WaitToComplete)
    
                    Loop While (strMessage <> "exit")
                    UDPClient.Close()
    
    
                Catch e As Exception
    
                    Console.WriteLine(e.ToString())
                End Try
            Loop
    and in python

    Code:
    import os
    while 1:
    	from socket import *
    	s=socket(AF_INET, SOCK_DGRAM)
    	s.bind(('',44126))
    	m=s.recvfrom(1024)
    	print m[0]
    	#Uncomment for Mac version
    	os.system("afplay ./ring.wav")
    	#Uncomment for Windows
    	#os.system("start .\ring.wav")
    and I had that part of it working in c# as well but I deleted it out of anger when I deleted my other 20 aborted projects
    Reply With Quote
     

  5. Collapse Details
     
    #65
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Code:
    var PORT = 44126;
    var HOST = '127.1.1.1';
    var client = dgram.createSocket('udp4');
    var play = require('play');
    
    
    client.on('listening', function () {
        var address = client.address();
        console.log('UDP Server listening on ' + address.address + ":" + address.port);
    });
    
    client.on('message', function (message, remote) {
    
        console.log(remote.address + ':' + remote.port +' - ' + message);
        play.sound('./sound-files/ring.wav');
    
    });
    
    //calling
    client.send(message, 0, message.length, PORT, HOST, function(err, bytes) {
    
        if (err) throw err;
        console.log('UDP message sent to ' + HOST +':'+ PORT);
    
    });
    No library needed to install UDP, except the audio "play" basically npm install play
    Last edited by juji; 03-17-2018 at 09:58 PM.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  6. Collapse Details
     
    #66
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    I simulated it, it looks like it's working.




    Left window is which it calls eg. sending a broadcast, basically a function which is related to client.send to what's address and some stuff.

    Right window is *when I receive a phone call* it outputs a log with some address info, it can do whatever like playing sound.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  7. Collapse Details
     
    #67
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    that's great now I have the same thing I already wrote in 5 languages
    Reply With Quote
     

  8. Collapse Details
     
    #68
    Аdministrator PROFESSIONAL WHITE SUPREMACIST's Avatar
    Join Date
    Dec 2012
    Posts
    9,127
    onyx-viper sounds like a deviantart fursona
    Reply With Quote
     

  9. Collapse Details
     
    #69
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    Quote Originally Posted by juji View Post
    I simulated it, it looks like it's working.




    Left window is which it calls eg. sending a broadcast, basically a function which is related to client.send to what's address and some stuff.

    Right window is *when I receive a phone call* it outputs a log with some address info, it can do whatever like playing sound.
    dude I can make applications that send packets back and forth all day long, that part is easy. I could do it with telnet and netcat without writing a single line of code. writing an android application that does it when you recieve a phone call is a pain in the balls.
    Reply With Quote
     

  10. Collapse Details
     
    #70
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    Code:
    public void myRealMethod(View view) {
    
            String messageStr = "Fuck java";
            int server_port = 44126; 
            try {
                DatagramSocket s = new DatagramSocket();
                InetAddress local = InetAddress.getByName("192.168.255.255");
                int msg_length = messageStr.length();
                byte[] message = messageStr.getBytes();
                DatagramPacket p = new DatagramPacket(message, msg_length, local, server_port);
                s.send(p);
     
            } catch (Exception e) {
               
            }
    java, that's 6 langauges
    Reply With Quote
     

  11. Collapse Details
     
    #71
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    I'm p sure that one works but I can't figure out how to fucking call a fucking method that doesn't fucking return anything
    Reply With Quote
     

  12. Collapse Details
     
    #72
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Why don't you make a client version for android? running a server in the mobile it's tedious, however you need to create a separate backend server.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  13. Collapse Details
     
    #73
    Аdministrator PROFESSIONAL WHITE SUPREMACIST's Avatar
    Join Date
    Dec 2012
    Posts
    9,127
    elzzz are u still a virgin? plz don't become a furry, qt mestiza hookers are so cheap in your country
    Reply With Quote
     

  14. Collapse Details
     
    #74
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Quote Originally Posted by PROFESSIONAL RAPIST View Post
    elzzz are u still a virgin? plz don't become a furry, qt mestiza hookers are so cheap in your country
    I'm not a furry, I have a lot of devices that have names like PC-325235, it's hard to remember which is device, however I renamed them like Fire-Horse, Grey-Falcon, Onyx-Viper, Black-Puma, etc.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  15. Collapse Details
     
    #75
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    Quote Originally Posted by juji View Post
    Why don't you make a client version for android? running a server in the mobile it's tedious, however you need to create a separate backend server.
    for the 20th time, what I want is a background service that sends a udp packet to notify other devices when the phone rings. I don't need a client application for android because the phone already knows it's ringing.
    Last edited by maks; 03-17-2018 at 10:29 PM.
    Reply With Quote
     

  16. Collapse Details
     
    #76
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    powershell, 7 languages

    Code:
    $port=44123
    $endpoint = new-object System.Net.IPEndPoint ([IPAddress]::Any,$port)
    $udpclient=new-Object System.Net.Sockets.UdpClient $port
    $content=$udpclient.Receive([ref]$endpoint)
    [Text.Encoding]::ASCII.GetString($content)
    write-host $content
    Reply With Quote
     

  17. Collapse Details
     
    #77
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Quote Originally Posted by maks View Post
    for the 20th time, what I want is a background service that sends a udp packet to notify other devices when the phone rings. I don't need a client application for android because the phone already knows it's ringing.
    The client version can do REST to backend server in real time which is background service that client is listening everytime, then call a sound file, the backend server is the alarm that sends udp packet to notify every devices when the phone rings.


    That's another possible design.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  18. Collapse Details
     
    #78
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    if I can't figure out how to read the phone state I can't do a goddamn thing
    Reply With Quote
     

  19. Collapse Details
     
    #79
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    You need to use this service https://www.twilio.com to get phone state, also it's used to make outbound calls


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  20. Collapse Details
     
    #80
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  21. Collapse Details
     
    #81
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    why do I need a voip api to use functionality that's built into android
    Reply With Quote
     

  22. Collapse Details
     
    #82
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    this is what I need I just don't know enough about the structure of an android project to get the fucking thing working

    https://developer.android.com/refere...eListener.html
    Reply With Quote
     

  23. Collapse Details
     
    #83
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    fuck java
    Reply With Quote
     

  24. Collapse Details
     
    #84
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Yeah, API levels and Permissions belong the Android systems are pain in the ass, even Java is outdated and shitty syntax to read like @Override and class with inside of function.

    However, NativeScript is fucking awesome, basically if you port Java shitty code to Javascript which is very easy to do UI.

    https://www.nativescript.org


    You showed me PhoneStateListener, I make an example as incoming call like this:

    Code:
    private class CallStateListener extends PhoneStateListener {
      @Override
      public void onCallStateChanged(int state, String incomingNumber) {
     
      }
    }
    tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
    tm.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE);
    It's ugly code, however it can be ported to Javascript with Nativescript.

    Code:
    var callStateListener = android.telephony.PhoneStateListener.extend({
    onCallStateChanged: function (state, incomingNumber) {
     
    }
    var application = require("application");
    var tm = application.android.context.getSystemService(android.content.Context.TELEPHONY_SERVICE);
    tm.listen(new callStateListener(), android.telephony.PhoneStateListener.LISTEN_CALL_STATE);
    It looks nice, you can integrate any elements as UI including getting phone state and incoming number.
    Last edited by juji; 03-18-2018 at 12:22 AM.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  25. Collapse Details
     
    #85
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    frankly I'd too irritated with the whole thing to spend any more time on it, but I'll give that a shot I think it's more or less the same thing dp recommended
    Reply With Quote
     

  26. Collapse Details
     
    #86
    Senior Member Visual Leader's Avatar
    Join Date
    Jan 2018
    Posts
    566
    So good

    Thanks g

    Uys
    [COOL LIST] Battery Bits, Lily, Knights Templar, snoofalew, poopalew [/COOL LIST]

    *****Official Rubynet Welcoming Committee Leader*****
    Reply With Quote
     

  27. Collapse Details
     
    #87
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    I got it working, sort of. I successfully spawned a background service, it detects incoming calls and sends a packet like it should. however

    on the emulator, I need to specify an address, a broadcast address won't work. probably because the emulator thinks it's on cellular and you can't broadcast on a wan

    on the actual phone, it only works if the app is in the foreground, the service doesn't seem to be listening after I hit the home button.
    Reply With Quote
     

  28. Collapse Details
     
    #88
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    18,000
    Quote Originally Posted by maks View Post
    I got it working, sort of. I successfully spawned a background service, it detects incoming calls and sends a packet like it should. however

    on the emulator, I need to specify an address, a broadcast address won't work. probably because the emulator thinks it's on cellular and you can't broadcast on a wan

    on the actual phone, it only works if the app is in the foreground, the service doesn't seem to be listening after I hit the home button.
    It sounds like you need a backend server to run UDP server to communicate bewteen the cellphones which are listening to specify address


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

  29. Collapse Details
     
    #89
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    What good is a background server going to do if the notifier application on the phone doesn't work
    Reply With Quote
     

  30. Collapse Details
     
    #90
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,312
    I need to figure out how services work in more depth
    Reply With Quote
     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

monde is a whiney fuck