Hello,
I Have made an application to localize pharmacy officines but with taking infos from an extrnal XML information feed
and now i want to integer only internal DB that i have made with SQLite
I have found a problem integrating it
I want to integer the DB into the app and delete the xml source
For information :
The Used API is 7 and 19
The Screen Size is about 4''
And i wanna to integrate Geocoder (It seems to not work in Algeria)
The App is made in French languge
Thanks For Help
I have attached DB and apk
Related
hi,
I have a program and it has lots of settings saved in memory, when I exis the program I need to save settings in a config file.
My program has CString(s), CArray(s) and other basic int and DWORD varibles, so how can I save such complex settings?
Mohammad
as xml maybe
If you're using MFC you could always attach a CArchive to a file and serialize
Perhaps you need to either create a log file - for debugging purposes or save your settings to the registry. If its the former then, check this one http://www.codeproject.com/ce/GenericLogFunctionality.asp it should be helpful. If its the latter, then you just search codeproject and you'll find lot of tutorials on the registry. Also, you can use CEDB which is a flat table data base that can store many data type structures including files and images, use it if you need to.
It may seem like you're lost now, but you can take an overview about the cons and pros of each technique so as to choose the best one for you.
For my config file I use plain english bounded by my own tags. I use a character sequence as a seperator for lists. I convert numerical values into text that can be human readable. There are some benefits to being able to read and edit it manually if the need arizes. I also made a class purely for writing and reading from my config file. Now when I to use a config file I can just drop that class into my project.
XML sounds good and similar but it would require a greater knowledge of xml.
Registry is easier and faster to do/execute but for data that can potentially grow too much it is probably best to keep it out of registry.
Is CArray serializable? do we just simply use CArray::Serialize and it will dump all included objects into a file?
thanks
http://msdn2.microsoft.com/en-gb/default.aspx
this site may be helpfull while you wait for somebody to answer your question
If you can it would be easier to use CObArray and ensure that the array members are subclassed from CObject with the DECLARE_SERIAL / IMPLEMENT_SERIAL macros. You could also add a new << operator to the CArchive class and write the serialization routine but that would kinda defeat the object I guess.
I solved the issue using serialization, for CArray structures I used the following method:
File<<MyArray.GetSize();//store how many objects
for(all my objects in the CArray)
serialize them one by one
I did the same when loading and it works flawlessly.
Thanks all for your help
Hi!
I try to integrate an external library into my vs2005 project while using the Windows Mobile 6 SDK. Of course, I added the additional directories and dependencies to the project settings, but I get some LNK2019 errors anyway.
So I created a dump of the *.lib files using "dumpbin.exe" and discovered that all function names start with a leading underscore. I found some precompiled parts of the library where there are no leading underscores in the function names and I can call them without any problems. But if I build those parts of the library on my own, there again are the LNK2019 errors and the "_functionname()" convention in the *.lib files.
Is there either a way to avoid those underscores when compiling the library or to call those function out of a windows mobile application?
Thanks in advance!
This looks a bit odd.
C++ decorates exported functions unless you add a def file to the project, but there is always way more garbage in the names.
What I don't understand is, why do you have a problem using a function that starts with an underscore?
Such names are perfectly acceptable in C / C++, in fact some C native functions like _wfopen start with an underscore.
What language are you programming in?
Also it might help find the solution, if you tell us what library you are using. Is it something available for download or your own creation?
Thanks for your quick reply.
I am working on a porting of the intel openCV computer vision library and I try to include it into a VS2005 C++ projekt created with the wizard for windows mobile 6.0 sdk for testing.
It seems that the problem appears when I switch the system to "/SUBSYSTEM:WINDOWSCE". Otherwise the library works perfectly.
Hi guys suddenly I have no experience with java and html parsing and I really need it...(possibly from http://www.uefa.com/teamsandplayers/teams/club=52280/domestic/index.html)
I want a simple way to convert an html website to xml document(fetch,convert,parse) or an easy alternative way to do it...
ps:if you know any alternative FREE resource of football(soccer) data tell it...
Android has built in several alternatives:
SAX Parser, XML Pull Parser and DOM.
A very good tutorial on all three of them can be found at IBM:
Working with XML on Android
I personally prefer the SAX Parser.
Of course you could just include another external parser, like HotSAX or many others via embedding external libraries.
In a small program I wrote I had to parse some html code, but the SAX Parser had problems with some German Umlauts. So I used TagSoup to clean the html and make a valid xml out of it. After that I could fetch the data with the SAX Parser.
thanks
wallla said:
Android has built in several alternatives:
SAX Parser, XML Pull Parser and DOM.
A very good tutorial on all three of them can be found at IBM:
Working with XML on Android
I personally prefer the SAX Parser.
Of course you could just include another external parser, like HotSAX or many others via embedding external libraries.
In a small program I wrote I had to parse some html code, but the SAX Parser had problems with some German Umlauts. So I used TagSoup to clean the html and make a valid xml out of it. After that I could fetch the data with the SAX Parser.
Click to expand...
Click to collapse
THANKS...maybe IBM example is good but a bit complicate for me(as i said i have no experience in parsing with java)...i prefer dom cause i get used to tree elements...
and if you can to publish some lines of source code with tagsoup(or refer me somewhere)...I NEED AN EXAMPLE
Here's a snippet of my program:
Code:
try {
URL url = new URL("http://www.url.com");
XMLReader xr = new Parser();
SAXHandler handler = new SAXHandler();
xr.setContentHandler(handler);
xr.parse(new InputSource(new InputStreamReader(url.openStream(), "ISO-8859-1")));
} catch (Exception e) {
}
You see, it's pretty simple...
The main part for "cleaning" the html-stuff is just this single line of code:
Code:
XMLReader xr = new Parser();
Parser() is of the type org.ccil.cowan.tagsoup.Parser;
If you want to use DOM, it should be quite similar.
Here's a basic example.
Let me introduce you my small library called NiceQL. It is free, open source and BSD-licenced.
It's main purpose is to make the process of creating databases easier. Hard-coding inside SQLiteOpenHelper is a no-go in my opinion. NiceQL gives developers a set of tools to create and manage database scheme, its tables, their columns and indices and preload seed data (data to be populated at first app launch). Library allows to generate database on a fly, load it from XML, use built-in SQL generators or use plain SQL (from XML too), you may also extend its objects or write new ones implementing Java interfaces.
Here's a quick code to start-up database with NiceQL and scheme in XML resource:
Code:
SQLiteDatabase db = new SchemeOpenHelper(this, "my_database", XmlScheme.parse(this, R.xml.sql_scheme)).getWritableDatabase();
The library is fully documented with examples on GitHub wiki. It does not handle database upgrades just yet, but this functionality will be implemented very soon.
I hope you will find it useful.
Hi
In the tutorial that i am reading says :
Any View object may have an integer ID associated with it, to uniquely identify the View within
the tree. When the application is compiled, this ID is referenced as an integer, but the ID is
typically assigned in the layout XML file as a string, in the id attribute. This is an XML attribute
common to all View objects (defined by the View class) and you will use it very often. The
syntax for an ID, inside an XML tag is:
android:id="@+id/my_button"
The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and
expand the rest of the ID string and identify it as an ID resource . The plus-symbol (+) means that
this is a new resource name that must be created and added to our resources (in the R.java file).
My question is this : In phrase ID resource , the resource word what does mean ???
I know about resources in Android a little but i guess that the ID resource is different from that . Please give me help
Thanks for your helps
All data from xml files (like layouts, menus, etc.) is called resource because it's not Java. In Java all resources can be accessed using the R class.
As you need to access the ids as well (for access to the Views), they are added to the R.java file.
So you're right. It's different from layout/menu/color/string resources. I guess that it's just due to the Java access.