From The Blog: Corona Roadmap 2018

Personally, I really hope Corona concentrates on adding more target OS’s - like Xbox, PS and Switch as that increases Corona’'s exposure and reach… that, as you know, other platforms build for.

With regard to internal metrics and usage, whilst valuable to you, presents a big issue for data protection rules in many countries - specially the EU (unless your end points are with in the EU which I very much doubt).  Will this be taken into account (for non-US devs) and will Corona allow for an opt in/out process as rules here are tough compared to the US?

In regards to getting more users, it might be worth Corona thinking of doing some form of out-reach program to developers using Unity to make 2D games and finding out why they chose Unity for that.

If it’s because they are also making 3D games and want the same toolset then you probably can’t persuade them to jump ship, but if they’re using it for other reasons - the asset store, bigger community, platform support, not aware of Corona, it’s what they know, etc - then those would be places where Corona could try to improve so that they can bring them over.

@glitchgames They should do the same with Defold. 

I’d forget about Unity’s audience, but becoming a good option for HTML 5 development would raise the interest in Corona by a great margin. It is a small, but a somewhat stable market.

Unity doesn’t support Canvas games, only WebGL which means the exports don’t run on mobile browsers. Most web game devs rely on JavaScript (or Haxe) frameworks that aren’t very good at producing (native) mobile builds and not too pleasant to use compared to Corona.

And exporting to Switch could make Corona a hit overnight. The interest is huge but even GameMaker doesn’t support it (yet).

Thank you for the answers Rob. I’d really love it if you could increase the number of votes and announce it with the newsletter to let everyone know about it.

Spent my 6 votes on Switch and XBox/Universal build support. I really think that those could give Corona more visibility if they are done right and not like Windows Phone support.

@gsimeonov, I tried that library but the code was a mess for me. If something went wrong, I worried that I couldn’t handle it so I gave up. I’d really prefer a built-in text manipulation option by Corona.

Hi, Just another thought regarding the “New Android sound subsystem based on modern API” item…

Would it be possible to include solving the excessive audio latency from screen tap to a sound being heard? I’ve studied the issue at length so I keep sound files short, preload them with audio.loadSound() and only play them later, I changed the audioPlayFrequency to 44100 (hz) and made sure my wav files are that rate also, etc etc.

It’s especially noticeable (even on my new model Galaxy S8+) when a display object or button is pressed quickly multiple times.  I see it discussed here for Unity

https://assetstore.unity.com/packages/tools/audio/android-native-audio-35295

someone there seems to have figured out a solution for the audio problem, but I love Corona!  Can this possibly be passed on to the engineers working on the Android Audio revisions? (It may give hints on how the other guys solved it in their world) but I want to stay in the Corona world!  

The docs for this Unity plugin says: ANA provides easy access to the native Android audio system for low-latency audio playback. You can play native audio with as few as three lines of code

Hopefully the new Android sound subsystem that is being worked on for Q1 2018 for Corona can allow a way to call the same low-latency audio playback functions?

Resolving this since the engineers are already working on the Android Audio API would  be an incredible boost for Corona on Android.

I saw latency mentioned with Corona above and here also: https://forums.coronalabs.com/topic/70237-superpowered-library-integration/?hl=%2Baudio+%2Blatency so I thought I’d ask.

Thanks so much!

We already provide direct access using the media.* APIs. These are fast and don’t have lags. However, you can’t preload sounds and you can’t mix multiple sounds (playing background music while making UI sounds for instance).

For our audio.* APIs you should always be pre-loading them anyway for small sounds. Large sounds files, like background music, should be loaded with audio.loadStream and then played when appropriate.

But I’ll make sure our engineers see this as I don’t know what the new Android audio system entails. 

Rob

  • New Android sound subsystem based on modern APIs

is this still looking like a reality for Q1 delivery?  (iow, still on track?)

 

it (or some other real fix to the openal android anr’s) is the only item on the whole year’s list that i’d care enough about to actually cast a vote for (if you were taking votes).

It should be on track for a Q1 release. 

Rob

Q1 is rapidly running out

Considering the release notes of the latest daily builds, it seems that Corona team will try to release them all at once.

Please consider developing android camera overlays as a priority.  Augmented Reality is about to become super hot commodity, and we are going to need it badly… I understand its complicated, but we really need it and I would rather be able to develop AR solutions within corona.

public class MMCC extends Activity {
Preview mPreview;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Hide the window title.
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

// Create our Preview view and set it as the content of our activity.
mPreview = new Preview(this);
GuideBox guideBox = new GuideBox(this); 

//camera preview
setContentView(mPreview);
//overlay guide box
addContentView(guideBox, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); 

public class GuideBox extends View {
public GuideBox(Context context) {
super(context);
// TODO Auto-generated constructor stub
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub

Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(Color.GREEN);

//center
int x0=canvas.getWidth()/2;
int y0=canvas.getHeight()/2;
int dx=canvas.getHeight()/3;
int dy=canvas.getHeight()/3;

//draw guide box
canvas.drawRect(x0-dx, y0-dy, x0+dx, y0+dy, paint);

super.onDraw(canvas);

Looking at that code, it’s looks simple, but it may not be that straight forward. Corona’s main display system is an OpenGL window. We would need to provide a video feed to an OpenGL object that can be put inside that window.  I suspect the use of the word canvas above isn’t referencing our OpenGL window.

If this was feasible, we would have done it.  I’ll ask engineering again, but I’m not sure if I will get a different answer.

Rob

Thanks for the feedback Rob,

Stuff like this is never easy but wow… what a feature set would be opened up to corona developers!

Here’s a bit more java/xml that does it… basically take the 

<?xml version=“1.0” encoding=“utf-8”?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width=“fill_parent”
android:layout_height=“fill_parent” >

<android.view.SurfaceView
android:id="@+id/surface"
android:layout_width=“fill_parent”
android:layout_height=“fill_parent” />

<ImageView
android:id = “@+id/header”
android:layout_width = “wrap_content”
android:layout_height = “wrap_content” />

</FrameLayout>

and for the java code you should extend SurfaceHolder.Callback in your activity and then attach the camera to the surface view like this,its my full code please be careful with bitmaps and canvas that is the tricky part :

public class MainActivity extends Activity implements SurfaceHolder.Callback
{
private Camera camera = null;
private SurfaceView cameraSurfaceView = null;
private SurfaceHolder cameraSurfaceHolder = null;
private boolean previewing = false;
RelativeLayout relativeLayout;

private Button btnCapture = null;
private Button btnsave = null;
private Button btnshare = null;
private boolean isSaved=false;
private boolean isCaptured=false;

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

getWindow().setFormat(PixelFormat.TRANSLUCENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.activity_main);

relativeLayout=(RelativeLayout) findViewById(R.id.containerImg);
relativeLayout.setDrawingCacheEnabled(true);
cameraSurfaceView = (SurfaceView)
findViewById(R.id.surfaceView1);
// cameraSurfaceView.setLayoutParams(new FrameLayout.LayoutParams(640, 480));
cameraSurfaceHolder = cameraSurfaceView.getHolder();
cameraSurfaceHolder.addCallback(this);
// cameraSurfaceHolder.setType(SurfaceHolder.
// SURFACE_TYPE_PUSH_BUFFERS);

btnCapture = (Button)findViewById(R.id.capturebtn);
btnCapture.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
camera.takePicture(cameraShutterCallback,
cameraPictureCallbackRaw,
cameraPictureCallbackJpeg);
isCaptured=true;
}
});
btnsave = (Button)findViewById(R.id.savebtn);
btnsave.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
FrameLayout frm = (FrameLayout)findViewById(R.id.frameLayout1);
frm.setDrawingCacheEnabled(true);
frm.buildDrawingCache();
Bitmap bitmap = frm.getDrawingCache();
try {
File rootFile=new File(Environment.getExternalStorageDirectory().toString()+"/MYCAMERAOVERLAY");
rootFile.mkdirs();
Random generator = new Random();
int n = 10000;
n = generator.nextInt(n);
String fname = “Image-”+ n +".png";

File resultingfile = new File(rootFile, fname);

if (resultingfile.exists ()) resultingfile.delete ();
try {
FileOutputStream Fout = new FileOutputStream(resultingfile);
bitmap.compress(CompressFormat.PNG, 100, Fout);
Fout.flush();
Fout.close();

} catch (FileNotFoundException e) {
Log.d(“In Saving File”, e + “”);
}
} catch(IOException e){
Log.d(“In Saving File”, e + “”);
}
isSaved=true;
}
});
btnshare = (Button)findViewById(R.id.sharebtn);
btnshare.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
if((isSaved)&&(isCaptured)){
// TODO sharing what ever we saved
// take the path

}

}
});
}

ShutterCallback cameraShutterCallback = new ShutterCallback()
{
@Override
public void onShutter()
{
// TODO Auto-generated method stub
}
};

PictureCallback cameraPictureCallbackRaw = new PictureCallback()
{
@Override
public void onPictureTaken(byte[] data, Camera camera)
{
// TODO Auto-generated method stub
}
};

PictureCallback cameraPictureCallbackJpeg = new PictureCallback()
{
@Override
public void onPictureTaken(byte[] data, Camera camera)
{
// TODO Auto-generated method stub
Bitmap cameraBitmap = BitmapFactory.decodeByteArray
(data, 0, data.length);

int wid = cameraBitmap.getWidth();
int hgt = cameraBitmap.getHeight();

// Toast.makeText(getApplicationContext(), wid+""+hgt, Toast.LENGTH_SHORT).show();
Bitmap newImage = Bitmap.createBitmap
(wid, hgt, Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(newImage);

canvas.drawBitmap(cameraBitmap, 0f, 0f, null);

camera.startPreview();

newImage.recycle();
newImage = null;

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);

startActivity(intent);

}
};

@Override
public void surfaceChanged(SurfaceHolder holder,
int format, int width, int height)
{
// TODO Auto-generated method stub

if(previewing)
{
camera.stopPreview();
previewing = false;
}
try
{
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(640, 480);
parameters.setPictureSize(640, 480);
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
camera.setDisplayOrientation(-90);

}

// parameters.setRotation(90);
camera.setParameters(parameters);

camera.setPreviewDisplay(cameraSurfaceHolder);
camera.startPreview();
previewing = true;
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@Override
public void surfaceCreated(SurfaceHolder holder)
{
// TODO Auto-generated method stub
try
{
camera = Camera.open();
}
catch(RuntimeException e)
{
Toast.makeText(getApplicationContext(), “Device camera is not working properly, please try after sometime.”, Toast.LENGTH_LONG).show();
}
}

@Override
public void surfaceDestroyed(SurfaceHolder holder)
{
// TODO Auto-generated method stub
try{

camera.stopPreview();
camera.release();
camera = null;
previewing = false;
}catch(Exception e){
e.printStackTrace();
}
}

Eh… Am I missing something here?

Why exactly is this difficult seen as Corona can already fill a rect with the camera?

https://docs.coronalabs.com/api/type/ShapeObject/fill.html#camera-source-fill

Making sense of that is an entirely different conversation!

Hi, I think Greg is looking for support for camera source fill …on Android.  Higher up in that doc https://docs.coronalabs.com/api/type/ShapeObject/fill.html#camera-source-fill it states “Camera Source — used to fill an object with the device camera source (iOS-only).”

I’d love to see it working on Android too. Augmented Reality was featured a the very top of the Google Play Store (Android) last week (or maybe the week before). I agree it’s going to be real hot. Would love to see support on Android too via Corona. With the speed that technology progresses I’m a little worried that over time 2D games will become less popular, Augmented Reality is a step in the right direction!!

I guess 3D is way out of scope (?) but I’d love to see that supported eventually too.  Doesn’t have to be 3D photorealistic worlds, just 3D geometry like in the apps Hocus (over 5 million installs) and Monument Valley (over 1 million installs). Hopefully might be a possibility in the long term?  I guess with enough math it might be a possibility now, but we love Corona for its ease of use and speed of development!

Ah I missed iOS only - that’s crap…

Agreed this should be cross platform at the very least - after all Android devices have had cameras for like as long as iOS devices.

Link real time camera view with Google maps API/GPS and then the combo is very powerful!

I agree AR is a powerful incentive for future development.

It’s just a shame that Corona is resource-constrained… 

Yes we need this for Android, I think the Android API has matured alot since this was last looked at, and that there is more of a chance of getting it done now from a technical perspective.  iOS cameras are easier to subclass, so camera source fill has been working on iOS for a long time.  Of all the things that would help Corona gain wider use, I think this is the biggest one… Ready Player One is out this coming weeked!

As 80% of my income comes from Android I can only agree.

Android is no longer the second best… it surpasses iOS in all metrics by some (considerable) margin.

I’ll watch Tomb Raider this week then next week is Player One for sure!

Is it possible to make that camera fill thing a plugin or is it something that can only be done by Corona team?