i lived in berkeley/oakland for several years (had to migrate south to the peninsula for work). i love the east bay. i agree 100% with The Pigeon's assessment of the bay area market. a story i read recently posited that landlords in more desirable parts of SF (i.e., the mission) are committing arson as a way to evict their rent-controlled tenants and jack the rent, sometimes by 4-5x. it is routine to see 1BRs going for 3500-4500+/mo in SF and ritzy parts of the peninsula -- truly insane.
i recommend looking for places around the north berkeley bart station (but not in the berkeley hills -- $$$), ashby bart, rockridge bart, and maccarthur bart. you could also look at lake merritt in oakland -- close enough to 19th st. bart station. not sure what your tolerance is RE: neighborhood/perceived safety, but i lived in areas that some of my friends called "shady" and i felt 100% safe all the time (and i'm a young woman who works crazy hours and comes home at weird times). i commuted to SF by BART regularly, and it's about 30 minutes from berkeley, less from oakland. you can also take your bike on BART at all times of day now, which is nice, and SoMa is a very easy bike commute from the downtown SF BART stations. you will not get a 30min overall commute if you are BARTing + biking, more like 45min-1hr.
general rules for berkeley: closer to campus = more expensive. north berkeley hills = super expensive. south and west berkeley = cheaper. don't know oakland as well. it's also super easy to be bike-only in berkeley - i did it for years. you could also drive to SF and try to find a decent long-term parking situation, but you have to factor in the bay bridge toll (6 dollars/day unless you're carpooling, which means 3 people, and which is 4 dollars i believe). lots of people take the casual carpool -- they wait at designated spots in the east bay for SF-bound cars to pick them up. that way the driver can take the carpool lane (faster, cheaper) and the passengers typically give the driver a dollar or so. BART both ways will run you about 8 dollars total, while driving is 6 + whatever your parking is (my husband has long-term parking for 160/mo, and it works out to just over 7 dollars/work day. casual carpool, i believe, is one-way only, bc the bridge toll is unidirectional (into SF), but i'm not 100% sure.
hopefully that helps!