How to design a Web application in django for mobile devices (phones / tablets) [closed] - django

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Is it possible to analyse the clients browser and serve a special designed layout for mobile devices?
In addition how to implement some fancy widgets usable on mobile-devices like "dropdown" and other things like date/time choices and so on? Not to forget the Style and art of whiping from one sceen to the next in smartphone or tablet way - How goes that?
I'm new on this kind of app/web - development, so any hint would be fine.
Conclusion so far: Use a Responsive Webdesign like bootstrap to address issues concernig small screens and changing aspect ratios and something like jQuery as Toolbox for Widgets.
The concrete question now ist how to implement all this into a 0815 'django app'?

I would suggest you to give a chance to Twitter Bootstrap http://getbootstrap.com/
It's becoming more and more popular when it comes to development of responsive web sites.
They recently realeased new version (Bootstrap 3) which is really great and it helps you to easily control what and how to disply on specific screen size.
If you want to learn more about it you could also visit this youtube channel http://www.youtube.com/user/CodersGuide?feature=watch

Well you can certainly make a list of common browser strings and create custom layouts for browsers most common on Android/iOS and serve those directly. (not preferred)
However the generally preferred method is to use CSS media queries for responsive web. These queries look something like:
#media screen and (min-device-width:321px)
{
...
}
#media screen and (min-width:769px)
{
...
}
#media screen and (min-width:1025px)
{
...
}
And in those locations where it says ... you can do custom classes/positioning/styling for all your elements. But Google is your friend in finding good tutorials for these.
Also there are many CSS/JavaScript libraries out there to create good buttons/layouts for mobile devices. These libraries often take into account that the touch areas for buttons need to be larger then the visible area, that there is enough spacing between elements. Often they also include "mobile" widgets, e.g. fancy dialog selectors that pop open and look just like the native popups on iOS or Android. Once again Google will be your friend.
If however you find yourself forced to do browser string comparisons don't expect your guess at the device to be correct. Browser strings are quite tricky and don't reveal a lot of information of the device. E.g. you may have no idea if the visitor is using Chrome for Android on a tablet or a smartphone. You can use browser strings to determine if the user is on Android or iOS for instance. But for Android don't expect to be able to identify all possible screensizes/devices on the market from the browserstrings.

Related

What issues coldfusion UI tags have [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have heard many times senior developers asking not to use coldfusion UI tags and that they cause problems. But can someone let me know what kind of problems it creates? I do not use CFML UI tags mostly, but some of the legacy code has them already. So if I have to change them, I need to convince people why they need to be changed. Reasons...
Edit:
I know this has been put on hold, but what I was asking about few points, a list kind of. So when I am talking with someone a client, fellow developer and want to emphasize the reason for not using cfform, I do have those reasons. With lot of good and some not so good answers, I reckon I can put up a list
1) They use old outdated versions of JavaScript libraries and HTML.
2) They have caused security issues in the past.
3) They get in the way of knowing how things actually work.
4) ColdFusion UI does work currently. However, the issue people have is simply, technology changes. It's simple as that really. jQuery and other UIs are constantly changing. Along with a lot of other APIs that ColdFusion UI uses. This means, if you are using ColdFusion 10 today and 5 years from now you are on ColdFusion 13 you may have issues with your ColdFusion 10's UI.
5) Another example is . had an issue recently because it uses google maps and google updated their API. Since the update took place it broke the tag. Since this is a ColdFusion UI and not your own it is difficult to just update the API calls. Which is why it is recommended to use your own. It's a simple fix with jQuery UI but not really ColdFusion UI.
6) Also, a lot of ColdFusion UI messes with your headers. For example, . This tag has been known to break mobile sites and other headers because it adds its own headers to your HTML page.
7) cfinput required="" is conflict with the HTML 5 input required=""
The issues with the UI tags built-in to CF are:
Were written by people who are not CFML developers.
Were written by people who are not HTML/JS developers.
They use old outdated versions of JavaScript libraries and HTML.
They have caused security issues in the past.
They get in the way of knowing how things actually work.
They don't have documentation comparable to the average JS library.
The Flash and XML versions of cfform were especially difficult to work with.
And possibly a few other reasons that have slipped my mind.
If you have old code that uses them, and the code works acceptably, then you're unlikely to get shot for not changing it - assuming there are no further undiscovered security issues, obviously.
(Though of course, whether the code does actually work acceptably or has simply been put up with may be a matter of debate.)
If you're working on new code, you should learn to use modern UI libraries that are written by actual JS developers who understand browsers, libraries that are far more widely tested and documented, that you can understand how they work, that put you in control of what's being done, and so on.
Instead of giving you a link to the solution to a problem that is unknown to #CFML_Developer I will simply briefly explain the issues I've had and other have had with ColdFusion UI.
ColdFusion UI does work currently. However, the issue people have is simply, technology changes. It's simple as that really. jQuery and other UIs are constantly changing. Along with a lot of other APIs that ColdFusion UI uses. This means, if you are using ColdFusion 10 today and 5 years from now you are on ColdFusion 13 you may have issues with your ColdFusion 10's UI.
Another example is <cfmap>. <cfmap> had an issue recently because it uses google maps and google updated their API. Since the update took place it broke the <cfmap>tag. Since this is a ColdFusion UI and not your own it is difficult to just update the API calls. Which is why it is recommended to use your own. It's a simple fix with jQuery UI but not really ColdFusion UI.
Also, a lot of ColdFusion UI messes with your headers. For example, <cfform>. This tag has been known to break mobile sites and other headers because it adds its own headers to your HTML page.
Finally, I personally find all ColdFusion UI more difficult to work with than actual jQuery UI. Just because with jQuery UI you can be specific to your needs and it's a lot more flexible to work with. Honestly, it's also faster to do if you understand jQuery.

How to build native C++ apps with HTML/CSS UI? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Is it possible to develop a C++ program while using HTML and CSS for the user interface? I know about programming with Javascript using a Webkit container, but I am really interested in C++ development.
I felt in love with C# WPF when I developed under Windows, but now I moved to Linux and I haven't found a good tool for using markup for interfaces. For this, I would like to mix HTML and CSS, which are very lightweight and easy to use, with C++ code, with something like WPF.
Oh, one more thing: I'm looking for desktop development, not web.
Yes, it is possible. What you want is a C++ web framework. You could start by looking at CppCMS—a Free High Performance Web Development Framework (not a CMS) aimed for Rapid Web Application Development.
Edit: After the question has been clarified, I think Awesomium would be a good fit for your needs.
You can achieve the same functionality by embedding WebKit (or Gecko) but as far as I know that is exactly what Awesomium does behind the scenes.
An alternative is librocket—a C++ interface middleware package designed for game applications. As you can guess from the description it is a good fit for games or real-time applications.
Sciter is exactly that - embeddable HTML/CSS engine with C/C++ API. Compact and multi-platform.
And check this article.
Sciter has the same feature set as WPF but uses HTML/CSS instead of XAML and uses native API.
Features out of the box:
HTML, CSS, SVG, aPNG (animated PNGs), image sprites,
<plaintext> - editor with syntax highlighting,
<htmlarea> - WYSIWYG HTML editor,
<frame type=pager> - print preview and HTML/CSS print,
animations,
HTTP client, REST/JSON client, WebSocket's, DataSockets,
etc.
The same application with Sciter UI running on Windows, MacOS and Linux from the same sources:
Disclaimer: I am an author of Sciter Engine.
2021 update: you can also use Sciter.JS that is version of Sciter that uses standard JavaScript (ES2020) script engine.
I think Electron would be a nice addition to the other answers.
It uses NodeJS to run a Webkit Window. Electron itself is only html/css/js, but you can use any Node Module within your Electron App - including custom, natively compiled C++ code. A possible Module to embed your C++ code would be node-gyp.
Be aware, however, that this workflow may include a little bit more JS than you would have with the other answers.
My favourite text editor, Atom, was made with Electron.
You can use Chromium Embedded Framework to embed HTML5 content in your app.
You'll get might and speed of Chromium and ability to build GUI apps the same way you develop web applications.
I suggest checking out Ultralight HTML UI Engine
Not Open Source, Available for C++. OpenGL and DirectX rendering supported.
Ultralight is the lighter, faster option to integrate HTML UI in your
C++ app.
It's made by the creator of Awesomium, who unfortunately decided to delete Awesomium.
If you need something more heavy weight I recommend taking a look at CEF. It’s a very powerful (and open source) tool.
I would suggest RmlUI
Its an active fork of librocket with more features. Its very modular, you can handle rendering, event handling and user input yourself (or copy one from provided examples).
Note: RmlUI doesn't support full HTML5/CSS3 specifications, but only a subset of it. Animations are supported tho.

language and database suitable for data driven game like football manager [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I have a Cricket management game (like Football Manager) written in VB 6.0 long back. It uses MS-Access as it's back-end and win-32 API calls to draw UI screens. It's a reasonably big game with 90,000+ lines of code.
Now, I want to re-write the game using other technologies like Java, Python, C++ etc. Basically I want to get out of Microsoft technologies (and preferably move to technologies that are available for free).
So, please help me out in choosing right technologies for Application-Logic, UI and Database. Below are my broader requirements regarding the three layers.
Application-Logic:
The game needs to make 1000s of calculations on in-memory data and constantly write that data to text files (Save game files). It also needs to do very fast database operations.
UI:
The UI need not be very robust. The only requirement is to be able to develop good looking screens with minimal animation effects. Below are the links to current screen images for your reference.
http://imageshack.us/g/148/89832593.png/
I might also add 2D graphics in the future.
Database:
The database contains around 20 tables with the larger tables containing up to 300000 records. Again, I want to use a free database like MySQL or flat text files. I am very curious to know about the database used by games like "Football Manager" or "Cricket Coach 2011"
Note: Please don't consider the efforts required to learn the proposed technologies. I will take care of them.
Update:
Now that I have decided to go ahead with C++ and SQLite, please direct me regarding the IDE and basic Tools/Libraries I should be using to start with.
I am already experienced in working with "Visual Studio" and "Eclipse". Can I use one of them? or can I go with QT (I read that QT is cross platform, but, is it just for mobile development or can I use it for desktop apps too)?
And,
How critical is the IDE selection initially?
Can I move to a different IDE at a later stage?
If I use Visual Studio, am I getting bound to Microsoft technologies?
If possible, please give me links to any examples to develop screens as in the links I provided above.
[I see now that an "online game" was an assumption on my part. So keep that in mind as you read this.]
I would take into consideration your hosting options. If you want to open-source this or operate it on a shoe-string budget, and run it on the widest array of available hosting services, then you probably want to go with LAMP technologies. This would rule out my favorite language, Java, as the underlying choice of language. PHP is almost always available on inexpensive hosting options. Perl and then Python are also available on many hosts, but PHP is practically guaranteed these days.
If however, you'll be hosting this in a "whatever it takes" environment, I'm a big fan of Java, Tomcat, JBoss, etc. But those technologies, while powerful, take a lot of time to ramp up to use, but more importantly, to use effectively and efficiently.
MySQL is a great choice these days for databases. Postgresql is another free option (in some ways, maybe free-er than MySQL, given MySQL's Oracle connection.) But MySQL is likely to be more readily available on a lot of inexpensive hosts. MySQL also qualifies under "very fast operation."
Regardless of database choice, do what you can to abstract your database code so that should you want to change (or need to change) you can do it with minimal fuss. PHP and Java both have well worn ORMs to help you in this regard.
It'd be interesting to see what kind of data models are used in a game like a * Manager title. I suspect it maps well to a relational database. But I'm personally on the lookout for a good reason to dabble with a NoSQL solution.
HTML and CSS for the client to start.
For a database, I would recommend SQLite: http://sqlite.org/
It's free, fast, and serverless. Serverless being key. There are some drawbacks that you can read about on their website, but for a stand-alone application, it should be much better than using text files.

Using Google Chromium's Views Project as an Application Framework in C++ [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have had contact with Google Chromium Code and that’s terrific for building applications with. The problem now lies that no-one has tried to use it outside Google Chromium Project. What I have in mind is to develop an open source project which may be used for this purpose. The fundamental goals would be:
Guarantee Linux-Windows support for the same code.
Take advantage of all resources available like thread control, stats, unit test…
Make it clearer how to use Skia for graphic effects and customizations.
Present a useful application doing the most of this.
Integrate C++ and JavaScript code using V8
Use Webkit for rendering html content
There’s a chance of it get off the paper. What do YOU think?
Claudio M. Souza Junior
Developer.
see https://github.com/lianliuwei/chromium_base
I create it for the same reason like you.
chromium is great project. It's code could be useful to using in other project. but It need time to extract it. I see one project to extract the ui part, but it change too many for noreason for example it change the .cc to .cpp. my project extract the base, ui, view part for the origin project, rm the ICU (it's so big) and gurl(you can add it quick) keep the gyp, gclient, grit-i18n, gtest, gmock... change the code little. and keep the extract history. I add a new type of messageloop for using it in the MFC(for company project :( ) now it can only work on Windows but it's no so hard to make it work on linux.(google do it all)
for use the browser in you project you can see the http://code.google.com/p/chromium/ for help.
It's great this project help you a litte. I at first think it's a no one care project.
I'm assuming you have looked at the extensively documented and developed QtWebkit and know why you don't want to use that?
I'm sure it will be easier to use V8 in a QtWebkit application than to somehow tear out Chromium's "View project".
Qt has the bonus that as long as you operate within the framework, everything will work on a lot of different platforms (more than Chomium now supports I think).

Looking for a resource which provides django templates [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm pretty handy with django and python but I'm terrible at the "visual" aspect of the web-design. Even after quite a bit of google-ing I haven't been able to find any sort of resource that has download-able templates complete with css, images, etc. that could be used to set up a basic website easily.
I'm looking for examples beyond the 5-line examples that you find in most tutorials ... I'm looking for something with the general nav-bar across the top, various content-blocks to over-ride through subclassing, footers, etc.
I've worked with others on django projects but always on the "coding side". I want to do my own project. I've set up all of the views, models, "business logic", I just cant get off the ground with the design section.
Any help would be appreciated.
Edit: Just to be a little more clear. I'm looking for designs (open licensed) ... akin to Wordpress themes. If you have a resource of just themes I can probably mung them into a django template but if you know of something that already provides them as templates I'd prefer that.
I've had some luck in the past with sites like OpenDesigns and FreeCSSTemplates -- they offer (mostly) CC-licensed HTML templates; you'll have to add the Django template stuff yourself. As James pointed out though, most of them will get you up and running, but you almost always want to take things a step further.
My advice: build up a small library of re-usable templates (using stuff from the above sites), get real comfortable editing HTML and CSS (because you will edit HTML and CSS), then find some kickass designers (preferably local) and get real friendly with them. Perhaps you can trade favors; you do some coding work for them, for free, and in return they do some design work for you. I've found that even if you have to pay, a good designer is well worth the money (seriously, who wants to spend their time testing sites in IE6?).
Good luck with your search though -- I, for one, would love to see your findings.
It seems like this is an area that is completely lacking. I've been looking for a django project, perhaps a meta-django project is a good way to go ;).
Maybe if designers could upload a set of templates against a simple and well defined set of models. They could upload a "main.html", "object_list.html", "object_detail.html", a css file and a few images. This would be something akin to the CSS Zen Garden project.
I've setup a github repository here: http://github.com/JudoWill/DjangoTemplateRepository. Feel free to log into the project and modify the wiki with requests.
The idea being to give newbies a starting point and a few examples for making their django website.
I suspect this has got nothing to do with django templates, your question sounds more of a design and markup. There are couple of css framework like Blueprint, 960, YAML.
I don't think you're going to be able to find what you're looking for unfortunately - I have the same problem.
Wordpress templates can assume a fairly well-known data model - every Wordpress installation uses the same predictable table names, every (say) blog page has a well-defined set of data that will be passed to the template - and even the plugins have only a limited number of plugin points to add extra data.
By contrast, your Django app could contain anything. I could provide you a pretty template, but unless the data I use in the template exactly matches your data model, it's not going to be useful. I could make the template very very generic - eg, just have it display the variable called 'form' if it's present, iterate over 'messages' if any are present at the top of the page, display a 'footer' at the bottom etc - but it will take you about 20 seconds before you want to customise the display of that form, and then you're back editing your own templates.
I think that the closest thing you're going to find are UI libraries like jQuery or YUI which can handle a lot of the work of making your UI look snazzy.
I'd like to be proven wrong though, it would save me going through the same trial as you're going through now.
Update: On re-reading this, it occurred to me that you're looking for a CMS, which Django is not. Two seconds of work with Google revealed django CMS. I haven't tried it, but maybe that's closer to what you're looking for? The django wiki has a comparison table of various django-based CMS solutions