Hello, i've decided to code a application for our committees in our university section. The basic function of the program should be to inform students about upcoming events hosted by different student unions/committees.
Events will be stored in an SQL database. Every event will have a few datas like "Committee name" "Description of event" "Date". The idea is that the app will get all events from the database that hasn't already been. It will display these in a list inside the application. If a new event is uploaded to the SQL database the application will give away a push-notification. And user will be able to display it. I have experience in C.
My questions are
Is there good graphic libraries and is it possible to do this with ease in C++?
Is it possible to make a program like this work in Android and IOS?
Would also appreciate general tips for people that've made mobile applications
C++ is not very popular in standard mobile applications (and it is not recommended, see, for instance Getting Started with the NDK | Android Developers[^].
For the an Android platform, Java is the natuaral programming language (altough you migh as well use C# via Xamarin).
As CPallini said C,C++ coding of Android is not for the faint hearted and I would not recommend it as things stand at current.
I can offer you a funny way into the problem for a medium level programmer which is to use the free Unity game engine. You write in C# and can run your code and debug it as a windows application on windows. Then you just select the target as android and it does all the conversion and crossing to Android for you.
You have a bit of learning to do with the unity interface but there are plenty of tutorials. The SQL classes already exist as standards in Unity like they do in .NET and is rather trivial as most online games store data in/from server databases.
On the plus side all the finger swipe libraries exist already and you can develop a groovy application look on the UI using the graphics stuff
Yes, I agree Richard but unless someone has done some work since I last tried compiling the code samples for the API even it was not trivial. I lost hours of time playing around with it as I needed old frameworks as well as 5 or 6 newer ones. If they have not improved it I would rate it as needing expert level knowledge but you may have more recent experience.
I have been trying to create a puzzle that can solve itself using BFS algorithm. Currently, the search algorithm and the main but I don't know how to integrate both of them together.
// Program to print BFS traversal from a given source vertex. BFS(int s)// traverses vertices reachable from s.
// This class represents a directed graph using adjacency list representationclass Graph
int V; // No. of vertices
list<int> *adj; // Pointer to an array containing adjacency listspublic:
Graph(int V); // Constructorvoid addEdge(int v, int w); // function to add an edge to graphvoid BFS(int s); // prints BFS traversal from a given source s
this->V = V;
adj = new list<int>[V];
void Graph::addEdge(int v, int w)
adj[v].push_back(w); // Add w to v’s list.
void Graph::BFS(int s)
// Mark all the vertices as not visitedbool *visited = newbool[V];
for(int i = 0; i < V; i++)
visited[i] = false;
// Create a queue for BFS
// Mark the current node as visited and enqueue it
visited[s] = true;
// 'i' will be used to get all adjacent vertices of a vertex
// Dequeue a vertex from queue and print it
s = queue.front();
cout << s << " ";
// Get all adjacent vertices of the dequeued vertex s// If a adjacent has not been visited, then mark it visited// and enqueue itfor(i = adj[s].begin(); i != adj[s].end(); ++i)
visited[*i] = true;
You must be desperate, seeing that you reverted to the SDK! Been there too, more than once!
Did you set the item(s) specifically as 'Owner Draw' in the Resource Editor!
If you did not, all the above quoted messages will end up in the 'Bit and Byte Bin', in the nearest toilet!
Hope this is helpful,
Client Side Code for Receiving data:
long nApproxSize = 900000;
int nEnd = 0;
long j = 0;
int nOffset = nApproxSize/100;
long nSize = sizeof(struct TagModalDB);
memset(EsimData, 0, nApproxSize);
Why clear the buffer to zeroes and then immediately overwrite it with data? The memset serves no purpose. Later you copy partial buffers into your large buffer a block at a time, again using memset for no good reason. Why not just receive the data direct into the large buffer?
Of coarse it slows down you send the client and server to sleep for 1/2 a second everytime it sends or recieves. You do get that sleeps the entire MFC framework don't you?
It appears to be a some sort of half arsed timing mechanism that will inevitably fail ... there are things called TIMERS for timing functions, use them.
If you want it blunt get rid of these and things will work a whole lot quicker =====> Sleep(500);
If you want me to be super blunt there is no good reason to sleep an MFC or any Win32 program ever, forget that call and never use it in proper code it's a hack we sometimes use when trying to proto stuff. There are a multitude of proper ways to load balance and wait for things in nice Windows proper ways.
This needs to be done properly but lets see if we can get this at least going, so let me guess at the next problem what is Transdata?
You loop in some sort of weird poll loop 100 times and call Transdata.Init ... if that is a constructor you just made 100 transdata and you never dispose of them. Check if it is your responsibility to dispose of TransData. However you can pull up windows resource manager and see if your client program memory growing and growing and growing because that will be the source and rather quickly. You don't dispose of transdata and if what I fear is true your program will leak memory like a sponge.
I actually can't get why you even need transdata, can't you just send the receive data to your buffer EsimData
Wouldn't something like
put the read data directly where you need it without the the need for transdata. I don't know what EsimData is so the format may not be right but explain why you can't directly put the data in in Esimdata.
I sort of need to know what Transdata and Esimdata are to help any further.
Finally if you really want to do the receiving by polling, which is fine then do it properly setup a timer and check for received data from time to time don't sit in a loop and spin your wheels for 100 times.
In vino veritas
Last Visit: 31-Dec-99 18:00 Last Update: 11-Apr-21 5:58