Android Programming: Touch Driving Drawings and Bitmaps on Canvas
1) Touch driving drawings and bitmaps on canvas 2) Customizing Views to handle touch 3) Capture and consumption of motion events 4) Source code of the ...
Android Application Development Tutorial - 42 - Using BitmapFactory and InputStream to set Bitmap
Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials! Have questions or looking for source code? Check out the forum at ...
I fooled around with a different way to fix that error using an 'if'
statement and a popup function i found via Google. P.S. also I used
WallpaperManager since setWallpaper is apparently old now.
if(bmp == null){
Toast.makeText(Camera.this,
"FAIL! Try taking a picture first.",
Toast.LENGTH_LONG).show();
}else{
myWallpaperManager.setBitmap(bmp);
Toast.makeText(Camera.this,
"SUCCESS! Wallpaper set.",
Toast.LENGTH_LONG).show();
}
+BoredNerdyGames I used the "if " statement in another way and it worked for me ! case R.id.bSetWall: if(bmp != null) { try { getApplicationContext().setWallpaper(bm); } catch (IOException e) { e.printStackTrace(); } } break;
just wanted you to know, your tutorials suck balls, I mean you are not
explaining anything, you just tell us to wait and understand while as you
go forward you act like we are already familiar with what you showed us in
the previous videos but did not explain
Well, if you had prior knowledge of java, this tutorial would be much better for you!So try to learn java first, and then come back and these tutorials will be very helpful
i think giving your bitmap an default picture is a really bad way to
program such an app. dont know why you didnt surround the onclickmethod for
setwallpaper with an if statement and just ask if(bmp == null) and set up
an AlertDialog to say hey dude you should make a picture first. would be
the proper way in my opinion
How about a thank you for taking the time and posting these wonderful (AND FREE) tutorials for all of us to enjoy, instead of criticizing his style? If you don't like his style, then watch someone else.
easy way for this and and better(sorry for bad eng.):
make int on start = 0, ask on setBacground is it 1 if it is not don't do
naythig if it is setBacground...on TakePic set it to 1...
Android Application Development Tutorial - 65 - Animating a Bitmap
Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials! Have questions or looking for source code? Check out the forum at ...
+Aditya Patel The command canvas.drawBitmap(gBall, canvas.getWidth()/2, 0, null); should become now canvas.drawBitmap(gBall, canvas.getWidth()/2, changingY, null);
How to create an android camera app using intents - Part 4
This android camera intent tutorial is part 4 of a six part series. In this tutorial we grab the thumbnail image returned back to us from the camera app and assign ...
Hi! Your tutorials are amazing!
But I seem to have gotten a bit of a problem here..
I take a picture. I click the tick sign..
The Image shows up too.. the problem is it's too blurry. Before selecting
the tick sign, i check the quality and its wonderful. But when the image is
displayed.. its all blurred out.
Please give me a solution.
+Arch Ok, the image that is returned in part 4 is only a thumbnail of limited resolution which is probably why you are seeing the blurriness. Try moving forward to part 5 & part 6 which should give you the full image.
Hi, great tutorial, i got an error while running the code at the last step,
i followed you with the code, i don't know what might be causing it, maybe
i forgot something, could you please help me?
here's the logcat
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: FATAL EXCEPTION: main
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: Process: com.example.alba.cameraintenttutorial, PID: 5769
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=0, result=-1, data=Intent { act=inline-data
(has extras) }} to activity
{com.example.alba.cameraintenttutorial/com.example.alba.cameraintenttutorial.CameraIntentActivity}:
java.lang.NullPointerException
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.deliverResults(ActivityThread.java:3432)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.handleSendResult(ActivityThread.java:3475)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.access$1300(ActivityThread.java:139)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5086)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: Caused by: java.lang.NullPointerException
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
com.example.alba.cameraintenttutorial.CameraIntentActivity.onActivityResult(CameraIntentActivity.java:71)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.Activity.dispatchActivityResult(Activity.java:5446)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.deliverResults(ActivityThread.java:3428)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.handleSendResult(ActivityThread.java:3475)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.access$1300(ActivityThread.java:139)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5086)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
11-10 03:08:48.170 5769-5769/com.example.alba.cameraintenttutorial
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
+Neo Herakles I think this is one of the biggest issues with android for both users & developers alike. There are number of devices that behave in manner not compliant with Android OS. The nexus phones are provided as a guideline for manufacturers to implement their devices. Now if you are using the google camera application and it's not providing you with the thumbnail data it's a bug in the implementation of your device which should be raised against the manufacturer.Workarounds are never a nice solution for particular problems like this, it means extra unnecessary code which has to be maintained and may induce new bugs.The tutorials I will be adding will be more of the intermediate / advanced levels but they will definitely give people more insight to issues such as these.
i'm using a Motorola Moto G 1st gen and i have Android 5.1 installed, i look forward to that tutorial, since i won't be able to continue further with this one until i am able to figure out a workaround
+Neo Heracles Thanks for that link, its the first I had heard of this one. I still have to implement the thumbnail support for camera2 but camera2 should work for part 6.What kind of hardware & android version are you using?The next tutorial series I will be releasing will be about the file & MediaStore providers and implementing their features in camera_intent & camera2. That may help resolve or provide a work around to these issues.
+Mobile Application Tutorials yes, just tested it, it takes pictures correctly, the errors seem similar to these https://kevinpotgieter.wordpress.com/2011/03/30/null-intent-passed-back-on-samsung-galaxy-tab/, although i'm a beginner and i can't really tell how could i fix it, should i try to implement an app using camera2 instead?
+Neo Herakles i look forward to continue with this tutorial and to do many others, i like the pace that you do these tutorials, very beginner friendly, thank you :)
Nigel, thank you for making tutorials like this! I have made the same
camera app, but I would test it with a different phone and the photo
appears sideways. Is this caused by the phone I am debugging with?
+Mobile Application Tutorials Oh awesome! Thanks for taking that explanation into consideration and for your quick response. I hope to see more from you soon.
+I Don't Like Spam Yes you should not see this behaviour with a nexus phone but will with some other devices. Unfortunately there is not really any consistent behaviour across all of the phones. Ideally the camera app should save the images at the correct orientation but that's not really happening. Therefore it's up to the gallery app to do the rotation before displaying the image. I'll look into an doing providing another tutorial at the end of this series explaining how to rotate to images to the correct orientations.
Great Camera apps..!! good job!.. Can you help on how will be able to send
this captured image to the server? By using php code..Thanks and more
power!
+Ferdie Abalos This channel is exclusively focused on mobile applications and those being android at this moment in time so I don't envisage seeing any server side php code here. That saying there could be a case for an android app communicating with a server api's either by using android third party libraries or by using JSON. Or by creating something using google app engine (java) which provides a good fit with android.