EndLessMind's Profile User Rating: -----

Reputation: 194 Stalwart
Active Posts:
1,100 (0.49 per day)
13-March 09
Profile Views:
Last Active:
User is offline Feb 02 2015 07:11 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:
Expert In:

Latest Visitors

Icon   EndLessMind Assigning myself to the Pause-method

Posts I've Made

  1. In Topic: Datagram socket

    Posted 29 Jan 2015

    You should not create the datagram socket in a loop. You should have the receive in a loop.

    something like:
    DatagramPacket p = new DatagramPacket(message, message.length);
    sock = new DatagramSocket(8801);
    while (true) {
     //Do what you want with it

    But there is a few problem with that code. For example, you have no safe way of stop listening for data.

    So, it would be better to have something like this

    private boolean runThread = true;
    byte[] message;
    public void startListening(final int port) { //final because we're using threads
       runThread = true;
       new Thread(new Runnable() {
         public void run() {
            message = new byte[128]; //You should change this to fit your needs.
    	DatagramPacket p = new DatagramPacket(message, message.length);
            DatagramSocket s = new DatagramSocket(port);
            s.setReuseAddress(true); //If you DON'T have this and you stop listening, then you'll have to wait for the system to flag that this address/port is available.
            while (runThread) { //If runThread gets set to false, it will stop receiving and close the socket and end the thread.
               //Do what you want with it
            s.disconnect(); //Might seam redundant to have this before "close();", but we just want to be sure that all connections get closed.
    public void StopListening() {
       runThread = false;

    That's basically it.
    This is written from the top of my head, so it's not copy and paste code.
    But there should only be maybe from upper case letter wrong and maybe some words misspelled :P
  2. In Topic: Android MediaPlayer -1004 IO Error

    Posted 30 Jun 2014

    Yeah, i know about that. You just need to reinstall the Android ADT.
    My problem, occurred on almost any Android version (from 2.3.3 and up) without even updating the app.
    So, no code change, stream is still the same and from the same source. So it's really strange.
  3. In Topic: Visualizing sound from the microphone

    Posted 12 Mar 2014

    View Postdinashehada, on 26 January 2014 - 10:55 AM, said:

    and where exactly in the code are changing recorded bytes into fft ? what should I do if I want to display the raw signal as recorded?? please help me I am very new to the canvas concept T.T

    For this visualization you don't need FFT, we are working with raw data.

    View Postalbinf, on 08 March 2014 - 11:10 AM, said:

    View PostEndLessMind, on 03 December 2013 - 05:36 AM, said:

    It is on it's way :)

    Hi EndLessMind, can you please send me the fixes too?(my mail id is ersi8906@hotmail.com) i'm running the app in my nexus 5 but it doesn't even start. when i run, it just blocks...
    thanks in advance

    View Postalbinf, on 11 March 2014 - 11:10 AM, said:

    View Postdinashehada, on 26 January 2014 - 03:46 AM, said:

    Hi Thank you,
    but I have a comment Iam trying this on a nexus 4 but the output signal does not seem to look like a sound wave it's very different and i was wondering how can I make it a little slower or make the (duration) of the visualizer larger so the signal would be clearer

    The same issue in my nexus 5..did you solve it??

    I've attached the code with the fix in this post.
    I can't remember what the problem where, but i think i fixed it (can't remember that either)

    View Postalbinf, on 12 March 2014 - 04:09 PM, said:

    View PostEndLessMind, on 08 December 2012 - 03:08 PM, said:

          int BuffIndex = (mBuffer.length / 2 - paramCanvas.getWidth()) / 2;
          int mBuffIndex = BuffIndex;

    Why do you initialize the BuffIndex this way?
    Initializing this way I find an ArrayIndexOutOfBoundException in

    int StartBaseY = mBuffer[(mBuffIndex-1)] / scale;

    Any idea??

    Yeah, the code is not perfect.
    Wrote it in like 2 hours.
    Check the attached project, there should be some fixes in there, but can't remember exactly which.

    and to everyone, sorry for the late response.

    Attached File  Tutorial Sound Visualizer.zip (1.39MB)
    Number of downloads: 572

    Posted 10 Mar 2014

    For privacy and security reasons there is not api-call you can make what will do the hard work for you.
    The code you're using only takes a screenshot of the view that you specified and only within your own activity.

    What you could do is, get the framebuffer and then decode it, as it only return the data in RGBA format.
    But, you'll need root or signature permissions


    "A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission"

    ADB has more permission then a app, so you will be able to read fb0 in the adb shell without root but you will not read it within the app without root.

    Hope this helps in some way
  5. In Topic: How to show some videos of a remote folder (server)?

    Posted 8 Mar 2014

    Okay. With a FTP server, it would work similarly, but the url would be like http://*ip*/videos/test1.mp4
    I would storage the url's in a MySQL database, and use a PHP script to get the url to the desired video (like searching for a video or what ever)
    But you don't need a download manager to watch the videos, you could just stream them directly from the server using a VideoView or MediaPlayer and the url. :)

My Information

Member Title:
These are the droids you're looking for
23 years old
May 18, 1992
Years Programming:
Programming Languages:
C++, VB .net 2005/2008/2010, C#

Contact Information

Click here to e-mail me
Website URL:
Website URL  http://https://www.facebook.com/GrooveMobile
Pontus EndLessMind Holmberg


Showing 50 random friends of 9


Page 1 of 1
  1. Photo

    idksiahh Icon

    06 May 2015 - 02:13
    Hi do you know how to click a button to extend a particular expandablelistview for Android Studio?
  2. Photo

    papastan Icon

    15 Dec 2014 - 10:38
    Hi please i am trying to write an android app to measure the the signal strength from 3 wifi access points in order to do indoor position for my work at school but i lack so much in programming and will be happy if you can help me. thanks
  3. Photo

    H3R3T1C Icon

    01 Jan 2013 - 02:37
    Congrats on the promotion to expert!
  4. Photo

    EndLessMind Icon

    10 Jun 2010 - 14:37
    Don't be shy :)
Page 1 of 1