Sphere in an android App
Saturday, September 21, 2024
Sunday, September 15, 2024
Sierpinki Gasket in an Android App
This project is a modification of an existing app I created earlier.
~TLDR: clone the repo https://github.com/bmkamath2000/mukBoApps and open in android studio to run.
Upon creating an android project in android studio there was a MainActivity.java automatically created in the src folder.
I instinctively guessed that I needed to declare a MyGLSurfaceView which extends a GLSurfaceView.
My guess turned true as I got a surface in the app when I created a run configuration and
launched the app using it.
I had some experience with rudimentary android app development over several years in the past.
As you can see onCreate of the MainActivity the view is set as content view.
In MyGLSurfaceView
I created a MyGLRenderer instance which is derived from GLSurfaceView.Renderer.
The MyGLRenderer declares a Triangle and draws it onDrawFrame.
I have Created the Triangle class which is based on the android official site:
https://developer.android.com/develop/ui/views/graphics/opengl/draw
The triangle is subdivided and on single or delayed click the number of triangles
triples or divides by a factor of 3.
Here is how it looks:
Thanks
Saturday, September 14, 2024
protobuf.dev getting started with protocol buffer example
Head over to the site https://protobuf.dev
In that site you will find things to compile a C++ and many other language projects with address book. Now just take a deep breath and dive in.
Warning: This is easy in Linux and verry verry difficult in Windows
If you find the going tough in that site, come here for I will get you some personal touch.
write_to_file.cpp
read_from_file.cpp
Thursday, September 5, 2024
Compile and execute a Simple example of working with Protobuf in C++
You can learn a lot by doing.
Ditto with CMake project building and running in Ubuntu.
An example cpp-protobuf-example in the github site https://github.com/afiskon/cpp-protobuf-example
comes up often in the google search and I tried compiling it in windows and it gave error.
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Its difficult to install protobuf in windows but I did it in Ubuntu(which is just an app in windows now with technology of windows subsystem for linux-WSL).
First I did a git clone with this cmd:
git clone https://github.com/afiskon/cpp-protobuf-example.git
then I changed directory to
cd cpp-protobuf-example/
After that I created a build directory by
mkdir build
followed by
cd build
followed by
cmake ..
which gave the same error as in windows. In ubuntu its much easier to install required libraries.
sudo apt-get install protobuf-compiler libprotobuf-dev
this command installed everything for me and I was good to go build the app.
cmake ..
worked like charm with following output:
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found version "3.12.4")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kamathbol/GitHub/cpp-protobuf-example/build
then the command
cmake --build .
[ 20%] Running cpp protocol buffer compiler on src/proto/Game.proto
[ 40%] Building CXX object CMakeFiles/proto.dir/Game.pb.cc.o
[ 60%] Linking CXX static library libproto.a
[ 60%] Built target proto
[ 80%] Building CXX object CMakeFiles/main.dir/src/Main.cpp.o
[100%] Linking CXX executable main
[100%] Built target main
then upon running the main
./main
Saving heroes...
Loading heroes...
Name: eax
HP: 50
XP: 256
Class: warrior
Weapon: sword
Arrows: 15
Name: afiskon
HP: 25
XP: 1024
Class: mage
Spellbook: fireball, thunderbolt,
Mana: 100
BTW here is the Main.cpp source that gets you this Output:
Saturday, June 29, 2024
YouTube Data API: Register for a free API key and use Python code to extract metadata from a YouTube channel
Search google for Google Developer Console: https://console.developers.google.com/project
Shutting down a Created Project:
So enable billing if you like paying money to google without any benefit in return.
So you have to create a project now. Click in create project and Type in a name for your organization. This will be mentioned when they bill for the services.
Go to Resource Pending Deletion here:
Then you will get a screen
Finally disable billing screen in billing section:After billing is disabled you will to get this:
Here is where you add a billing account:
This is the project dashboard before I delete my project just for the heck of it.I casually went to project settings and clicked shutdown again to see what it entails:
This was incidentally the first screenshot:
This screen says it all: