ios database SQLite

http://www.theappguruz.com/blog/use-sqlite-database-swift

Advertisements

xml문서 doc, element로 가져오기

https://dobest51.wordpress.com/2017/06/26/java-xml%ED%8C%8C%EC%9D%BC%EC%97%90%EC%84%9C-string-data-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0/     String response = mOAuthLoginInstance.requestApi( mContext, at, url ); try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(response)); Document doc = db.parse(is); Element resp = (Element) doc.getElementsByTagName("response").item(0); //사용 방법은 아래와 같다. uid = resp.getElementsByTagName("id").item(0).getTextContent(); name = resp.getElementsByTagName("name").item(0).getTextContent(); email = resp.getElementsByTagName("email").item(0).getTextContent(); created_at = "2017";

android studio에 jar file import하기

1. File > Project Structure 선택 2. 상단의 + 선택 3. Import .JAR or .AAR Package 선택 4. jar 선택 후 Subproject name에 해당 항목의 이름을 정한 후 Finish 5. 1번의 Project Structure화면에서 app > Dependencies 탭 선택 6. 오른쪽의 + 선택 > Module Dependency 선택 7. 4번에서 만든 모듈 선택

custom ArrayList에서 sort하기

Comparable를 implement한 뒤에, CompareTo 메소드를 오버라이딩한다. 삽입하는 값이랑, 기존의 값을 비교하여 1, -1을 return한뒤에, Collections.sort(weeklyInfo); // 날짜가 낮은 것부터 다시 들어가도록 한다 그 다음에 이와 같이 sort를 사용하면 된다 public class WeeklyEvent implements Comparable<WeeklyEvent>{ public String firstDayofWeek; SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy년 MM월 dd일"); private String pluskey; private String minuskey; private int score; public WeeklyEvent(String … Continue reading custom ArrayList에서 sort하기

Imageview 사이에 line 그리기

canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint); @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); //Draw previous rectangles for(int i=0;i<rectangles.size();i++){ canvas.drawRect(rectangles.get(i), paintColor ); } Rect ourRect = new Rect(); ourRect.set(0, 0, canvas.getWidth()/2, canvas.getHeight()/2); Paint paintColor = new Paint(); if(MainActivity.isBlue){ paintColor.setColor(Color.BLUE); } paintColor.setStyle(Paint.Style.FILL); //Draw to actual canvas canvas.drawRect(ourRect, paintColor ); rectangles.add(ourRect) } } https://stackoverflow.com/questions/15544026/draw-line-between-two-cordinates-in-ondraw-in-android https://stackoverflow.com/questions/20641869/canvas-ondraw-android onDraw안에 이를 넣어준다. - … Continue reading Imageview 사이에 line 그리기