16,022,752 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by vn12 (Top 11 by date)
vn12
12-Nov-14 2:08am
View
Have changed the code returned the filter also..but my problem is same..:(
vn12
11-Nov-14 23:59pm
View
Can u give some idea what should i do..will be very helpful..
vn12
11-Nov-14 7:17am
View
ohk.sorry for my mistake..was aware of this..Thnx for editing it..can u give me some solution for my query?? :(
vn12
11-Nov-14 6:33am
View
format means what should i do??
vn12
10-Nov-14 9:20am
View
my listview is not getting updated when m clearing edittext...m updating new code with
vn12
10-Nov-14 9:04am
View
Deleted
my listview is not getting updated when m clearing edittext...m updating new code with
vn12
30-Oct-14 10:29am
View
which event is useful for my query??
vn12
30-Oct-14 8:00am
View
i dont want autocompletetextview..need a simple search box and button::(
vn12
30-Oct-14 7:21am
View
Have gone through this example and have Apache POI..i just want to display data of my excel sheet into android app.so i implemented only readExcelFile method..but uts not working
Here is my code:
SearchActivity.java
package com.medicine.meditracker;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class SearchActivity extends ActionBarActivity implements OnClickListener {
Button readExcelButton;
static String TAG = "ExelLog";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
readExcelButton = (Button) findViewById(R.id.readExcel);
readExcelButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId())
{
case R.id.readExcel:
readExcelFile(this,"medicine.xlsx");
break;
}
}
private static void readExcelFile(Context context, String filename) {
if (!isExternalStorageAvailable() || isExternalStorageReadOnly())
{
Log.e(TAG, "Storage not available or read only");
return;
}
try{
// Creating Input Stream
File file = new File(context.getExternalFilesDir(null), "medicine.xlsx");
FileInputStream myInput = new FileInputStream(file);
// Create a POIFSFileSystem object
POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);
// Create a workbook using the File System
HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);
// Get the first sheet from workbook
HSSFSheet mySheet = myWorkBook.getSheetAt(0);
/** We now need something to iterate through the cells.**/
Iterator rowIter = mySheet.rowIterator();
while(rowIter.hasNext()){
HSSFRow myRow = (HSSFRow) rowIter.next();
Iterator cellIter = myRow.cellIterator();
while(cellIter.hasNext()){
HSSFCell myCell = (HSSFCell) cellIter.next();
Log.d(TAG, "Cell Value: " + myCell.toString());
Toast.makeText(context, "cell Value: " + myCell.toString(), Toast.LENGTH_SHORT).show();
}
}
}catch (Exception e){e.printStackTrace(); }
return;
}
public static boolean isExternalStorageReadOnly() {
String extStorageState = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(extStorageState)) {
return true;
}
return false;
}
public static boolean isExternalStorageAvailable() {
String extStorageState = Environment.getExternalStorageState();
if (Environment.MEDIA_MOU
vn12
1-Oct-14 8:32am
View
Hello,Thanks for the code..
My 2&3 problem is solved.one problem is there..if i does not select any option and pressed next button then timer is starting again.
1)if user does not select any option and timer finishes then it should move to next question by making the missed question answer as Wrong.
vn12
1-Oct-14 6:50am
View
Deleted
Hello,Thanks for the code..
My 2&3 problem is solved..now the 1st one is remaining....
1)if user does not select any option and timer finishes then it should move to next question by making the missed question answer as Wrong.
Show More