LaurenceBedford's Forum Posts

  • Hi, guys, I'm looking for an android studio developer to help me add some features to my app that construct 3 doesn't support.

    Reply below with your contact details:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi guys I have script that extracts text from a PDF file:

    When a user picks a pdf file with the file chooser how do i then use that file in my script? And then save the output to a variable?

  • You'll need an addon for this, and I really doubt it exists.

    dop2000

    You can do it with js:

    mozilla.github.io/pdf.js/examples

    But I can't seem to get this to work?

  • What do you mean by "uploaded file", uploaded where?

    File Chooser allows to choose a file from your hard drive. See this demo:

    https://www.dropbox.com/s/ajghqcbjy79b70z/FileChooserHack.c3p?dl=0

    If you need to read the contents of the file, after the file is selected, you can request FileChooser.FileURLAt(0) with AJAX, and then set your variable to AJAX.LastData

    dop2000

    Thanks, it works now! -

    How do I get the text from pdf file now?

  • Hi guys how do I use the file chooser to get the text from an uploaded file and save it into a variable?

  • > > > Try this : drive.google.com/file/d/0B8mc-_g50xBlbUhxNDFmNGhkTXc/view

    > >

    > > Its not letting me open this file in construct 3, as it is a construct 2 (caproj) file ;(

    >

    > That's weird as I can open it in c3. Try again?

    Whenever I try opening it, it says: "Construct 2 folder based projects, (.caproj files) cannot be exported to Construct 3. To import the project, first export it as a single file (.capx file) and import that."

    Hmm maybe that is a bug - As I seem to be able to open it fine.

  • > Try this : drive.google.com/file/d/0B8mc-_g50xBlbUhxNDFmNGhkTXc/view

    Its not letting me open this file in construct 3, as it is a construct 2 (caproj) file ;(

    That's weird as I can open it in c3. Try again?

  • SOLVED

    Through some miracle, dark magic and the process of elimination I seemed to have managed to get this working. Now i can take a picture with the camera and this image is uploaded to the Sentisight api for image recognition. A result is then returned to my device with the recognition data.

    For anyone who might need something similar in the future, here is how the successful call looks...

    The event sheet should read>>>>>>>>

    // do SentiSIght API request

    + UserMedia: On snapshot ready

    -> AJAX: Request UserMedia.SnapshotURL (tag "got_snapshot_data")

    + AJAX: On "got_snapshot_data" completed

    -> Functions: Call Do_Sensight_Request (image: UserMedia.​SnapshotURL)

    * On function 'Do_Sensight_Request'

    * Parameter 'image' (String)

    -> Run JavaScript:

    file_in= await runtime.assets.fetchBlob(localVars.image);//THIS LINE WAS THE KEY TO THE FIX

    predict();

    and then the predict function and POST request in a JS script looks like this:

    > 
    var file_in;
    const baseApiURL = "https://platform.sentisight.ai/api/";
    var token;
    
    function predict() {
    				
    
    	token = "XXXXX";
    	const projectId = "XXXX";
    
    	const modelName = "my_model_name";	
    
    	const file = file_in;
    
    	var fr = new FileReader();
    	fr.onload = function() {
    		results = JSON.parse(apiPostRequest('predict/' + projectId + '/' + modelName, fr.result));
    		console.log(results);
    		alert(results);
    
    	}	
    	fr.readAsArrayBuffer(file);
    
    }
    
    function apiPostRequest(request, body) {
    	var xmlHttp = new XMLHttpRequest();
    	xmlHttp.open( "POST", baseApiURL + request, false );
    	xmlHttp.setRequestHeader('Content-Type', 'application/octet-stream');
    	xmlHttp.setRequestHeader('X-Auth-token', token);
    	xmlHttp.send(body);
    	console.log(xmlHttp.responseText);
    	alert ("Resp :"+xmlHttp.responseText);
    	return xmlHttp.responseText;
    }

    Grimmy

    I have been trying to do this for ages! Still can't seem to get it to work can you share a capx?

  • LaurenceBedford I didn't make Doptrix with Construct. It was a native Android app developed in Java, there are ways to check if an app with a specified ID is installed on the device.

    dop2000 Oh right.

  • Hi guys I need some help I want my app to allow a user to share the current url they are on in chrome etc to my android app using the share feature.

    I have a found many tutorials like this:

    code.tutsplus.com/tutorials/android-sdk-receiving-data-from-the-send-intent--mobile-14878

    But how can I use this with construct 3? Can someone get a demo/plugin?

    I know there's an option for exporting to android studio but I want to remain in construct 3. I basically want the user to share the url they are on to my app and then the url is saved into a global variable.

    Can we do this with JS in c3 - can anyone get this working! -- I have tried for ages now!

  • dop2000 How did you make the doptrix unlocker app. I mean how does it work - how can the other app determine whether the other one is installed etc

  • dop2000 Looks Awesome - can't wait to play it!

  • Are you asking about that elastic effect? You can do it with Tween:

    https://www.dropbox.com/s/fz895tguzshbtey/ElasticSlider.c3p?dl=0

    dop2000

    This Is Brilliant Thanks!

  • Hi guys how can I integrate this with c3? codepen.io/chrisgannon/pen/xweVNM and set where the slider is in a variable.