Return to Level1Techs.com

Devember 18 - Erzor

devember2k18

#1

I, Erzor, will participate to the next Devember. My Devember will be to make LineageOS for my device, learn Android Studio, and learn/finish my Python college course. If I somehow finish all of these, I will learn artificial intelligence. I promise I will program for my Devember for at least an hour, every day of the next December. I will also write a daily public devlog and will make the produced code publicly available on the internet. No matter what, I will keep my promise*.

I will try my darndest, but this seems really fun to get together and learn coding with a bunch with others! Found this on here, and the community there is so heartwarming! Once Devember is done though, I will move solely onto my Medium blog, for convenience sake :slight_smile: .

Let me know if you are participating and see you tomorrow! I’ll be posting in this thread to hopefully not spam the others :slight_smile:


#2

Woohooo!

Good luck! :slightly_smiling_face:

should I add you to the participants list?


#3

Yes, of course! Thanks! :slight_smile: (Whoops, sorry didn’t know about this list, first time doing Devember XD)


#4

no problem, also my first time :slightly_smiling_face:

just was lucky to see all the Devember planing and posts from the start :+1:


#5

Day 1:
Link

Too lazy to post here, because there’s going to be formatting issues :confused:


#6

Devember Log 2
Alright, completed the hour today and here is what I learned! I copied some summaries by Google to help myself :P.

  • Official Android Developer Documentation for reference: developer.android.com
  • Android Studio provides templates for common and recommended app and activity designs. These templates offer working code for common use cases. Helps for referencing.
  • When you create a project, you can choose a template for your first activity.
  • While you are further developing your app, activities and other app components can be created from built-in templates.
  • Creating different activities leads to a stack (Imagine a pancake stack, where clicking through the app adds to the stack, while going back takes the top one off)
  • You can send data to different activities

I got extremely slowed down at 2.1 Task 4 because I was trying to understand what the code was doing. I know I don’t fully understand how to use the syntax properly, but hopefully by the end of this course I can get enough repetition drilled into my head that it sticks with me and I know how to do things like send data to another activity or make a button do something. However, I can also reference the sample code/projects or documentations as well, but they are kinda wordy :confused: (Any advice on how you guys know the syntax well?). I’m going to spend 5 minutes now trying to understand the code I just copied and how it makes the app work. I rushed at the end so I can bookmark the next Task for tomorrow, otherwise I would have had to reread the task I did today, to see where I left off. Anyways, see you tomorrow!

Edit:

I totally forgot how to say what to do about .apk files (Thanks @anotherriddle for reminding me XD)!! Here’s a great site to explain just that (under Sideloading). If you don’t trust my .apk files (which you should rightly be skeptical) feel free to scan them with https://www.virustotal.com/. It’s owned by Google and scans a file/website/anything really for malicious intent using a variety of different antivirus and antimalware programs. The best part is that it’s all online and you don’t have to download anything! Use your best judgement, since they can also give false negatives and/or false positives!

I also wasn’t able to build an app for today because most of the reading I did were exercises. Hopefully I can produce something tomorrow that you guys can have fun with XD!


#7

Devember Log 3
This week is dead week for me as professors are trying to make students turn in stuff the week before finals… So not much will happen this week for Android Studio. That said, I’m going to talk about what we did in my Python class.

  • Did easy problems sets that utilized lists and dictionaries to solve the problem. There could have been more efficient ways but meh :stuck_out_tongue:

And that’s it! See you tomorrow!


#8

Ugh, I don’t want to admit it, but I procrastinated today…

So I have a project due tomorrow, and instead of working on either my college or personal project, I decided to binge youtube… for around 3 hours… Yeah totally not proud about that…

I still am planning to keep going at this; 1 faulty day doesn’t mean I can’t do it. I’m planning to wake up early tomorrow and work on Android Studio and read a bunch of your guy’s blogs (really want to know how ya’ll doing! :smiley:). Hopefully that will make amends…

I might have to wake up early to focus on this project and get in an hour of code until this Friday as I literally have big projects or tests every single day of the week…

Sorry to be a bummer, but see you tomorrow.


#9

All good, get right back on that horse!

image


#10

Hahaha! Love that reference @ArgGrr! One Punch Man is hilarious XD. Anyways onto my Log.

Log 5
Well rip. Slept through and didn’t wake up until later than I expected :confused:. But I still got my work done! Check the github page!
Well it isn’t much, even if I did spend one hour on it… I’m having a hard time wrapping my head around intents (which is how you transition from one “scene” of the app to the other). It’s not how it works that I don’t get, but the overly complex amount of code that is needed to implement it AND send extra data with it. I was starting to read the book to see what it said, but the timer went out, and I don’t want to burn myself out this early in the game. Anyways, I’ll continue reading that tomorrow. Thanks for reading!


#11

I cant see link for Github page?


#12

#13

Log 6

Still really confused at how I can implement Intents… I know what it does, but there are so many steps involved to implement it, it just makes it really confusing to me :confused:. It’s not as simple as
String string = "Blah Blah"
as I hoped it was :confused:. Oh well…

I did the 2.1 Challenge that the course suggested that I do, and I put the source code for my solution in my github. I don’t usually put the source code for these exercises because they are already available on Google’s github, and mine is pretty much exactly the same, but I put this one cause I’m pretty sure my solution is different from Google’s.

I’m now onto the part where it talks about how the scene (technical terms is Activity) is loaded. I know a bit about this because I watched a deprecated video by Google about it, but I’ll still write about it next blog. I’m just in the middle of reading it right now XD.

Anyways thanks for reading and see you next time!


#14

Log 7
Updates galore! (Thanks to Google cause I just copied and pasted this :P)

  • The Activity lifecycle is a set of states an Activity migrates through, beginning when it is first created and ending when the Android system reclaims the resources for that Activity.
  • As the user navigates from one Activity to another, and inside and outside of your app, each Activity moves between states in the Activity lifecycle.
  • Each state in the Activity lifecycle has a corresponding callback method you can override in your Activity class.
  • The lifecycle methods are onCreate(), onStart(), onPause(), onRestart(), onResume(), onStop(), onDestroy().
  • Overriding a lifecycle callback method allows you to add behavior that occurs when your Activity transitions into that state.
  • You can add skeleton override methods to your classes in Android Studio with Code > Override.
  • Device configuration changes such as rotation results in the Activity being destroyed and recreated as if it were new.
  • A portion of the Activity state is preserved on a configuration change, including the current values of EditText elements. For all other data, you must explicitly save that data yourself.
  • Save Activity instance state in the onSaveInstanceState() method.
  • Instance state data is stored as simple key/value pairs in a Bundle. Use the Bundle methods to put data into and get data back out of the Bundle.
  • Restore the instance state in onCreate(), which is the preferred way, or onRestoreInstanceState().

However, I have to let you know that I did not do the complete hour. I had eight minutes left, but I was too lazy to continue, so instead of forcing myself to do more, I just saved it for tomorrow. This is because the next challenge code builds on top of the previous section, so it’s being a huge pain in the butt because it is combining intents with overriding methods for activities… As if it wasn’t confusing enough… Ugh.

Anyways, thanks for reading and see you next time! Any advice for shortcuts on Intents or overriding the Activity methods would be gladly appreciated!


#15

Log 8

Was getting bored and confused with the progression and confusion of Activities and Intents (Google words it heavily and I think I’m going to have to briefly reread it/work on how to do it myself), but instead of giving up, I did a side project! I made a Cookie Clicker app!

I know, I know, stop the groaning… It was one way to prevent myself from getting bored with continuing it. So let me talk about it!

For one thing I know I can have improved it by a lot. I made a new timer object for each auto clicker, and I could have optimized it by a lot if I made one object with a changing delay/counter. I also didn’t use Intents and Activities (obviously cause I’m still confused about them XD). I don’t save the clicks either so when you close the app, all the clicks are gone :P.

Other than the flaws, it’s a pretty standard Clicker app. I was mainly making an app to continue onto LineageOS development (I’ll talk about that more tomorrow, if fattire does let me continue on from this), so if fattire does say this is a valid app and that I can continue to LineageOS, I’m going to save Android app development for summer (initially was going to trash it, but the cookie clicker app was fun to make XD).

You can find all this on my github. Have fun and see ya tom!


#16

Log 9

I skipped 2.2’s Challenge of Intents and Activities. I’m going to watch youtube tutorials on how to implement those. I instead moved onto Implicit Intents (2.3).

Imo, this was much easier to understand as it was similar to 2.2’s explicit Intent in how it was structured. I have made the app and it’s now in my github.

Two non-pressing questions I have though are these 1) what ShareCompat.IntentBuilder does and what is “geo:0,0?q=” for location Intents. I’ll probably learn about this in my youtube videos that I look up, and if I do, I’ll write it in a future blog.

Last blog, I briefly mentioned what LineageOS is and now I am going to talk about it. Briefly, it’s just another operating system for your Android phone. However, the most appealing thing to me is the ability to update to the latest version of Android. I have a Samsung S3, and doing this would be amazing to do imo XD.

Also, I think I spent 2 hours today (didn’t keep a timer, so I’m approximating), so I think I made up for the time I didn’t do a blog. Winter break is almost here and I can’t wait to work on this basically the whole time! So excited :D!


Edit:
Just figured out what was wrong with me not understanding explicit intents. It’s actually really easy, but I was getting hung up on the layout (as the instructions had layout and intent code mixed together). It made it confusing to read, so the second time I read it, I skipped the layout code and read only the logic, and I understood it.


#17

Log 10

Was about to skip today because I was lazy and have a final tomorrow, but charged through it anyways :stuck_out_tongue:. Don’t worry, my final tomorrow is programming and it’s a piece of cake; I was just lazy on doing this project until now XD.

Anyways, here’s what I learned!

Implicit Intents:

  • An implicit Intent allows you to activate an Activity if you know the action, but not the specific app or Activity that will handle that action.
  • An Activity that can receive an implicit Intent must define Intent filters in the AndroidManifest.xml file that match one or more Intent actions and categories.
  • The Android system matches the content of an implicit Intent and the Intent filters of any available Activity to determine which Activity to activate. If there is more than one available Activity, the system provides a chooser so the user can pick one.
  • The ShareCompat.IntentBuilder class makes it easy to build an implicit Intent for sharing data to social media or email.

Debugging

  • View logging information in Android Studio by clicking the Logcat tab.
  • Run your app in debug mode by clicking the Debug icon or choosing Run > Debug app.
  • Click the Debug tab to show the Debug pane. Click the Debugger tab in the Debug pane to show the Debugger pane (if it is not already selected).
  • The Debugger pane shows (stack) Frames, Variables in a specific frame, and Watches (active tracking of a variable while the program runs).
  • A breakpoint is a place in your code where you want to pause normal execution of your app to perform other actions. Set or clear a debugging breakpoint by clicking in the left gutter of the editor window immediately next to the target line

I figured that even though I don’t know Intents all that well, I should just continue learning other stuff. I know how to do it generally, but if I don’t know the specifics Google can always help me out :stuck_out_tongue:

Also, I’ll have to skip tomorrow’s blog because I have a math final the day after tomorrow… Yippee multivariable calculus… So I am basically going to study for that all day since I haven’t studied at all cause I love to procrastinate (sarcasm at its finest :confused:). Anyways thanks for reading and catch you in the next one!

Edit: Where have ya been something_sithy/Cal Al? Been awhile. Hope everything’s alright.

Also, Terminal is giving away cash prizes here! I might do it since I have a break soon. You should too!


#18

Good luck for the final! :shamrock:
I’m also studying for exams right now, so you are not alone with this problem. That’s life.


#19

Thanks @anotherriddle! Good luck to you too! :slight_smile: Sadly, I lost my virginity today to my math final… onto the log :confused:

Log 12

Today I learned about unit tests and support libraries, and it felt pretty useless to me. I’m not planning to pursue this as a corporate endeavor, and I feel as this would be mainly helpful for testing between many different people in a corporation. Not going to bore you with the details but overall, listening to my music and regretting regrets was more entertaining than this.

Onwards! :muscle:


#20

Log 13

Learned about clickable images and fabs (Floating Action Button). The images were fine; basically set up the same way as button and used the same attributes as a button. Nothing groundbreaking here.

Fab’s on the other hand were extremely poorly worded. It literally skips a bunch of the process of how you can interact with Fabs. Luckily after 20 mins of struggling, I found this to help me interact with my fab and continue with the next Activity, but I still didn’t know how to change the picture on it (Instruction literally say to add image into the resource folder and do nothing else… how does the program know it wants that picture you just put in?!)… Ended up just glazing over the rest of 4.1, and going to continue with 4.2 later.

Anyways, frustration aside, I learned a bit today. Luckily, I don’t think I’ll be using Fabs anytime soon.